summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-03-08 14:36:25 +0000
committerRichard W.M. Jones <rjones@redhat.com>2012-03-08 18:14:36 +0000
commit3dc9386af003157e3627f4889361e362f0722423 (patch)
tree482f2bbabb362d47428dfbecd7c2e6816782cb0e
parent6cdc5abd38c8caa1ff1e1c45c4a976899d384f01 (diff)
downloadlibguestfs-3dc9386af003157e3627f4889361e362f0722423.tar.gz
libguestfs-3dc9386af003157e3627f4889361e362f0722423.tar.xz
libguestfs-3dc9386af003157e3627f4889361e362f0722423.zip
dbdump: Avoid double-close on error path (found by Coverity).
Error: USE_AFTER_FREE: /builddir/build/BUILD/libguestfs-1.16.5/src/dbdump.c:132: freed_arg: "pclose" frees "pp". /builddir/build/BUILD/libguestfs-1.16.5/src/dbdump.c:142: deref_arg: Calling "pclose" dereferences freed pointer "pp". (cherry picked from commit 3f3b08a6bc610ca0886e02972257dfcb633a9d40)
-rw-r--r--src/dbdump.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/dbdump.c b/src/dbdump.c
index ca035db1..8242dee2 100644
--- a/src/dbdump.c
+++ b/src/dbdump.c
@@ -131,6 +131,7 @@ guestfs___read_db_dump (guestfs_h *g,
/* Catch errors from the db_dump command. */
if (pclose (pp) != 0) {
perrorf (g, "pclose: %s", cmd);
+ pp = NULL;
goto out;
}
pp = NULL;