[Libvir] [PATCH] Plug saslUsernameWhitelist leak.
by Jim Meyering
Here's the last one:
Plug saslUsernameWhitelist leak.
* qemud/qemud.c (qemudCleanup): Free the array as well as
the strings in it.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
qemud/qemud.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/qemud/qemud.c b/qemud/qemud.c
index 7ccc9ee..96fdf32 100644
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -1661,6 +1661,7 @@ static void qemudCleanup(struct qemud_server *server) {
free(*list);
list++;
}
+ free(server->saslUsernameWhitelist);
}
#endif
--
1.5.4.3.366.g55277
16 years, 8 months
[Libvir] [PATCH] Plug remoteReadConfigFile leak.
by Jim Meyering
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(a)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
16 years, 8 months
[Libvir] [PATCH] Avoid two more leaks.
by Jim Meyering
Here are two more:
Avoid two more leaks.
* src/capabilities.c (virCapabilitiesFree): Free host.migrateTrans.
(virCapabilitiesFreeGuest): Free arch.name member.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
src/capabilities.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/capabilities.c b/src/capabilities.c
index 2544bd3..bedd445 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -91,6 +91,7 @@ virCapabilitiesFreeGuest(virCapsGuestPtr guest)
int i;
free(guest->ostype);
+ free(guest->arch.name);
free(guest->arch.defaultInfo.emulator);
free(guest->arch.defaultInfo.loader);
for (i = 0 ; i < guest->arch.defaultInfo.nmachines ; i++)
@@ -130,6 +131,10 @@ virCapabilitiesFree(virCapsPtr caps) {
virCapabilitiesFreeHostNUMACell(caps->host.numaCell[i]);
free(caps->host.numaCell);
+ for (i = 0 ; i < caps->host.nmigrateTrans ; i++)
+ free(caps->host.migrateTrans[i]);
+ free(caps->host.migrateTrans);
+
free(caps->host.arch);
free(caps);
}
--
1.5.4.3.366.g55277
16 years, 8 months
[Libvir] [PATCH] Plug a leak.
by Jim Meyering
I ran valgrind via "make check" and found some leaks.
This fixes the first:
Plug a leak.
* src/capabilities.c (virCapabilitiesFreeGuestDomain): Free dom->type.
(virCapabilitiesAddGuestDomain): Remove duplicate strdup stmt.
Signed-off-by: Jim Meyering <meyering(a)redhat.com>
---
src/capabilities.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/src/capabilities.c b/src/capabilities.c
index 263935c..2544bd3 100644
--- a/src/capabilities.c
+++ b/src/capabilities.c
@@ -73,6 +73,7 @@ virCapabilitiesFreeGuestDomain(virCapsGuestDomainPtr dom)
for (i = 0 ; i < dom->info.nmachines ; i++)
free(dom->info.machines[i]);
free(dom->info.machines);
+ free(dom->type);
free(dom);
}
@@ -328,9 +329,6 @@ virCapabilitiesAddGuestDomain(virCapsGuestPtr guest,
if ((dom->type = strdup(hvtype)) == NULL)
goto no_memory;
- if ((dom->type = strdup(hvtype)) == NULL)
- goto no_memory;
-
if (emulator &&
(dom->info.emulator = strdup(emulator)) == NULL)
goto no_memory;
--
1.5.4.3.366.g55277
16 years, 8 months