Fix memory leaks found with valgrind
Signed-off-by: Lon Hohberger <lon@users.sourceforge.net>
This commit is contained in:
parent
1fce42fdb0
commit
16aafe3974
@ -465,9 +465,11 @@ libvirt_shutdown(backend_context_t c)
|
||||
VALIDATE(info);
|
||||
|
||||
if (virConnectClose(info->vp) < 0) {
|
||||
free(info);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
free(info);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -569,6 +569,8 @@ mcast_shutdown(listener_context_t c)
|
||||
|
||||
VALIDATE(info);
|
||||
info->magic = 0;
|
||||
history_wipe(info->history);
|
||||
free(info->history);
|
||||
free(info->args.key_file);
|
||||
free(info->args.addr);
|
||||
close(info->mc_sock);
|
||||
|
@ -391,6 +391,8 @@ serial_shutdown(listener_context_t c)
|
||||
info->magic = 0;
|
||||
stop_event_listener();
|
||||
domain_sock_cleanup();
|
||||
history_wipe(info->history);
|
||||
free(info->history);
|
||||
free(info->uri);
|
||||
free(info->path);
|
||||
free(info);
|
||||
|
@ -28,7 +28,7 @@ struct perm_group {
|
||||
static void
|
||||
static_map_cleanup(void **info)
|
||||
{
|
||||
struct perm_group *groups = (struct perm_group *)info;
|
||||
struct perm_group *groups = (struct perm_group *)(*info);
|
||||
struct perm_group *group;
|
||||
struct perm_entry *entry;
|
||||
|
||||
|
@ -562,7 +562,7 @@ int
|
||||
stop_event_listener(void)
|
||||
{
|
||||
run = 0;
|
||||
pthread_cancel(event_tid);
|
||||
//pthread_cancel(event_tid);
|
||||
pthread_join(event_tid, NULL);
|
||||
event_tid = 0;
|
||||
|
||||
|
@ -46,6 +46,9 @@ domain_sock_setup(const char *domain, const char *socket_path)
|
||||
if (connect(sock, (struct sockaddr *)sun, SUN_LEN(sun)) < 0)
|
||||
goto out_fail;
|
||||
|
||||
free(sun);
|
||||
sun = NULL;
|
||||
|
||||
node = malloc(sizeof(*node));
|
||||
if (!node)
|
||||
goto out_fail;
|
||||
|
Loading…
Reference in New Issue
Block a user