[PATCH] Plug remoteReadConfigFile leak.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]