[Libvir] [PATCH] Plug remoteReadConfigFile leak.

Another. This happens only upon reading an invalid config file. Plug remoteReadConfigFile leak. * qemud/qemud.c (remoteReadConfigFile): Be careful to free "conf" after a successful virConfReadFile. Signed-off-by: Jim Meyering <meyering@redhat.com> --- qemud/qemud.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qemud/qemud.c b/qemud/qemud.c index 9ce9edd..851e83e 100644 --- a/qemud/qemud.c +++ b/qemud/qemud.c @@ -1877,7 +1877,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename) GET_CONF_STR (conf, filename, tcp_port); if (remoteConfigGetAuth(conf, "auth_unix_rw", &auth_unix_rw, filename) < 0) - return -1; + goto free_and_fail; #if HAVE_POLKIT /* Change default perms to be wide-open if PolicyKit is enabled. * Admin can always override in config file @@ -1886,11 +1886,11 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename) unix_sock_rw_mask = 0777; #endif if (remoteConfigGetAuth(conf, "auth_unix_ro", &auth_unix_ro, filename) < 0) - return -1; + goto free_and_fail; if (remoteConfigGetAuth(conf, "auth_tcp", &auth_tcp, filename) < 0) - return -1; + goto free_and_fail; if (remoteConfigGetAuth(conf, "auth_tls", &auth_tls, filename) < 0) - return -1; + goto free_and_fail; GET_CONF_STR (conf, filename, unix_sock_group); if (unix_sock_group) { -- 1.5.4.3.366.g55277

On Mon, Mar 03, 2008 at 01:18:46PM +0100, Jim Meyering wrote:
Another. This happens only upon reading an invalid config file.
Plug remoteReadConfigFile leak. * qemud/qemud.c (remoteReadConfigFile): Be careful to free "conf" after a successful virConfReadFile.
Looks fine to me, +1, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (2)
-
Daniel Veillard
-
Jim Meyering