Plug memory leaks and fix open(2) error check.
Reviewed by: nwhitehorn MFC after: 3 days
This commit is contained in:
parent
a68d1eca2c
commit
c725e3ef7a
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user