X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fappliance.c;h=822fe772e889e87ae6a64ec13fc1be928abb47af;hb=25791edff58665a949807081d131ef74e74a2d7c;hp=6629abbcc375815af363ad4bf43473b8d390822d;hpb=68fcbb6f5f50d631af90b05da7e5e2efa5de0b46;p=libguestfs.git diff --git a/src/appliance.c b/src/appliance.c index 6629abb..822fe77 100644 --- a/src/appliance.c +++ b/src/appliance.c @@ -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; }