[libvirt] PATCH: Fix leak in libvirtd daemon when reporting errors

When reporting libvirt errors back to the client, we forgot to free the memory associated with the remote_error object - principally the char * message strings. So every error reported would leak some memory. This patch free's the memory Daniel diff -r 1bd5f9fd5393 qemud/remote.c --- a/qemud/remote.c Fri Jan 30 11:01:29 2009 +0000 +++ b/qemud/remote.c Fri Jan 30 11:01:52 2009 +0000 @@ -363,6 +363,7 @@ rpc_error: remoteDispatchGenericError(&rerr); if (!xdr_remote_error (&xdr, &rerr)) goto fatal_error; + xdr_free((xdrproc_t)xdr_remote_error, (char *)&rerr); } /* Write the length word. */ -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Jan 30, 2009 at 11:44:35AM +0000, Daniel P. Berrange wrote:
When reporting libvirt errors back to the client, we forgot to free the memory associated with the remote_error object - principally the char * message strings. So every error reported would leak some memory. This patch free's the memory
Sounds a fairly important fix, +1 Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

Daniel Veillard <veillard@redhat.com> wrote:
On Fri, Jan 30, 2009 at 11:44:35AM +0000, Daniel P. Berrange wrote:
When reporting libvirt errors back to the client, we forgot to free the memory associated with the remote_error object - principally the char * message strings. So every error reported would leak some memory. This patch free's the memory
Sounds a fairly important fix, +1
Yeah, really. ACK
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Jim Meyering