summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-03-08 14:49:23 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-03-08 15:02:41 +0000
commit270daae52b6a96b4d05cbe03e0b31a0b2e4ac1ae (patch)
tree9db2fb372efae273569fb77a095037c7f1404adc /src
parent3f3b08a6bc610ca0886e02972257dfcb633a9d40 (diff)
downloadlibguestfs-270daae52b6a96b4d05cbe03e0b31a0b2e4ac1ae.tar.gz
libguestfs-270daae52b6a96b4d05cbe03e0b31a0b2e4ac1ae.tar.xz
libguestfs-270daae52b6a96b4d05cbe03e0b31a0b2e4ac1ae.zip
inspect_apps: Avoid double-close on error path (found by Coverity) (RHBZ#801298).
Error: USE_AFTER_FREE: /builddir/build/BUILD/libguestfs-1.16.5/src/inspect_apps.c:392: freed_arg: "fclose" frees "fp". /builddir/build/BUILD/libguestfs-1.16.5/src/inspect_apps.c:404: deref_arg: Calling "fclose" dereferences freed pointer "fp".
Diffstat (limited to 'src')
-rw-r--r--src/inspect_apps.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/inspect_apps.c b/src/inspect_apps.c
index 603e25d4..0ee39546 100644
--- a/src/inspect_apps.c
+++ b/src/inspect_apps.c
@@ -392,6 +392,7 @@ list_applications_deb (guestfs_h *g, struct inspect_fs *fs)
if (fclose (fp) == -1) {
perrorf (g, "fclose: %s", status);
+ fp = NULL;
goto out;
}
fp = NULL;