git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfc0a5f
)
lib: Fix memory leak when debugging enabled (found by valgrind).
author
Richard W.M. Jones
<rjones@redhat.com>
Thu, 24 Nov 2011 15:50:54 +0000
(15:50 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Thu, 24 Nov 2011 15:51:16 +0000
(15:51 +0000)
If you enabled debugging (eg. LIBGUESTFS_DEBUG=1) then every
debug message printed would be leaked.
src/guestfs.c
patch
|
blob
|
history
diff --git
a/src/guestfs.c
b/src/guestfs.c
index
f4b79e7
..
450ffd8
100644
(file)
--- a/
src/guestfs.c
+++ b/
src/guestfs.c
@@
-373,6
+373,8
@@
guestfs___debug (guestfs_h *g, const char *fs, ...)
if (len < 0) return;
guestfs___call_callbacks_message (g, GUESTFS_EVENT_LIBRARY, msg, len);
+
+ free (msg);
}
/* Call trace messages. These are enabled by setting g->trace, and