X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fappliance.c;h=822fe772e889e87ae6a64ec13fc1be928abb47af;hb=25791edff58665a949807081d131ef74e74a2d7c;hp=56838825855027ef4ff575f81a0f943f36f330fa;hpb=4e0cf4dbf8a8a96288f70114fdc3939da0aa7ad1;p=libguestfs.git diff --git a/src/appliance.c b/src/appliance.c index 5683882..822fe77 100644 --- a/src/appliance.c +++ b/src/appliance.c @@ -240,7 +240,7 @@ calculate_supermin_checksum (guestfs_h *g, const char *supermin_path) return NULL; } - if (pclose (pp) == -1) { + if (pclose (pp) != 0) { warning (g, "pclose: %m"); return NULL; } @@ -401,6 +401,12 @@ check_for_cached_appliance (guestfs_h *g, /* Releases the lock on checksum. */ if (close (fd) == -1) { perrorf (g, "close"); + /* Allocated in hard_link_to_cached_appliance above, must be + * freed along this error path. + */ + free (*kernel); + free (*initrd); + free (*appliance); return -1; } @@ -539,6 +545,12 @@ build_supermin_appliance (guestfs_h *g, /* Releases the lock on checksum. */ if (close (fd) == -1) { perrorf (g, "close"); + /* Allocated in hard_link_to_cached_appliance above, must be + * freed along this error path. + */ + free (*kernel); + free (*initrd); + free (*appliance); return -1; }