diff --git a/usr.sbin/bsdinstall/distextract/distextract.c b/usr.sbin/bsdinstall/distextract/distextract.c index 397932f24cc..a76ebfe6458 100644 --- a/usr.sbin/bsdinstall/distextract/distextract.c +++ b/usr.sbin/bsdinstall/distextract/distextract.c @@ -49,6 +49,7 @@ main(void) dists = calloc(ndists, sizeof(const char *)); if (dists == NULL) { fprintf(stderr, "Out of memory!\n"); + free(diststring); return (1); } diff --git a/usr.sbin/bsdinstall/distfetch/distfetch.c b/usr.sbin/bsdinstall/distfetch/distfetch.c index 0ced75cd7be..bb72417bfac 100644 --- a/usr.sbin/bsdinstall/distfetch/distfetch.c +++ b/usr.sbin/bsdinstall/distfetch/distfetch.c @@ -48,6 +48,7 @@ main(void) urls = calloc(ndists, sizeof(const char *)); if (urls == NULL) { fprintf(stderr, "Out of memory!\n"); + free(diststring); return (1); } diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinstall/partedit/gpart_ops.c index 52f145eecae..6bbce172048 100644 --- a/usr.sbin/bsdinstall/partedit/gpart_ops.c +++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c @@ -301,7 +301,7 @@ gpart_bootcode(struct ggeom *gp) return; bootfd = open(bootcode, O_RDONLY); - if (bootfd <= 0) { + if (bootfd < 0) { dialog_msgbox("Bootcode Error", strerror(errno), 0, 0, TRUE); return;