diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2011-08-23 19:50:11 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-08-23 19:50:11 +0100 |
commit | ce18be33cd5279a8d4120eedd037400c275585c0 (patch) | |
tree | 40fc1c82f49de130625494e6ca51d9fe6e17bbe1 /src/appliance.c | |
parent | a31ac8fc32297cc9185fd20a5578d2bc81cc1bce (diff) | |
download | libguestfs-ce18be33cd5279a8d4120eedd037400c275585c0.tar.gz libguestfs-ce18be33cd5279a8d4120eedd037400c275585c0.tar.xz libguestfs-ce18be33cd5279a8d4120eedd037400c275585c0.zip |
Coverity: fix memory leak along error path.
Diffstat (limited to 'src/appliance.c')
-rw-r--r-- | src/appliance.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/appliance.c b/src/appliance.c index 9f869540..836e6792 100644 --- a/src/appliance.c +++ b/src/appliance.c @@ -402,6 +402,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; } @@ -540,6 +546,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; } |