diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-03-08 14:49:23 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-03-08 18:14:36 +0000 |
commit | 1bb711b605959677a6c5046fbf081b79e93e7ed2 (patch) | |
tree | 7ba3ae35b48c87a7d6ea574c91c580e81f685973 | |
parent | 3dc9386af003157e3627f4889361e362f0722423 (diff) | |
download | libguestfs-1bb711b605959677a6c5046fbf081b79e93e7ed2.tar.gz libguestfs-1bb711b605959677a6c5046fbf081b79e93e7ed2.tar.xz libguestfs-1bb711b605959677a6c5046fbf081b79e93e7ed2.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".
(cherry picked from commit 270daae52b6a96b4d05cbe03e0b31a0b2e4ac1ae)
-rw-r--r-- | src/inspect_apps.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/inspect_apps.c b/src/inspect_apps.c index 2f3e3f15..a61248b3 100644 --- a/src/inspect_apps.c +++ b/src/inspect_apps.c @@ -391,6 +391,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; |