mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 19:41:16 +00:00
Fix valgrind complaints when using kill -SIGHUP on libvirtd
This patch fixes a couple of complaints from valgrind when tickling libvirtd with SIGHUP. The first two files contain fixes for memory leaks. The 3rd one initializes an uninitialized variable. The 4th one is another memory leak.
This commit is contained in:
parent
986c208695
commit
18b6323ab9
@ -2239,6 +2239,7 @@ virNWFilterPoolObjLoad(virConnectPtr conn,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VIR_FREE(pool->configFile); // for driver reload
|
||||
pool->configFile = strdup(path);
|
||||
if (pool->configFile == NULL) {
|
||||
virReportOOMError();
|
||||
|
@ -1403,12 +1403,14 @@ virStoragePoolObjLoad(virStoragePoolObjListPtr pools,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
VIR_FREE(pool->configFile); // for driver reload
|
||||
pool->configFile = strdup(path);
|
||||
if (pool->configFile == NULL) {
|
||||
virReportOOMError();
|
||||
virStoragePoolDefFree(def);
|
||||
return NULL;
|
||||
}
|
||||
VIR_FREE(pool->autostartLink); // for driver reload
|
||||
pool->autostartLink = strdup(autostartLink);
|
||||
if (pool->autostartLink == NULL) {
|
||||
virReportOOMError();
|
||||
|
@ -1092,6 +1092,12 @@ x86MapFree(struct x86_map *map)
|
||||
x86ModelFree(model);
|
||||
}
|
||||
|
||||
while (map->vendors != NULL) {
|
||||
struct x86_vendor *vendor = map->vendors;
|
||||
map->vendors = vendor->next;
|
||||
x86VendorFree(vendor);
|
||||
}
|
||||
|
||||
VIR_FREE(map);
|
||||
}
|
||||
|
||||
|
@ -941,9 +941,11 @@ virPipeReadUntilEOF(int outfd, int errfd,
|
||||
|
||||
fds[0].fd = outfd;
|
||||
fds[0].events = POLLIN;
|
||||
fds[0].revents = 0;
|
||||
finished[0] = 0;
|
||||
fds[1].fd = errfd;
|
||||
fds[1].events = POLLIN;
|
||||
fds[1].revents = 0;
|
||||
finished[1] = 0;
|
||||
|
||||
while(!(finished[0] && finished[1])) {
|
||||
|
Loading…
Reference in New Issue
Block a user