mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
Fri Feb 20 17:49:22 IST 2007 Mark McLoughlin <markmc@redhat.com>
Fix a few leaks * qemud/qemud.c: qemudCleanup(): free the socket structures * qemud/conf.c: fix various leaks in the xml parsing * qemud/iptables.c: fix a typo causing a leak
This commit is contained in:
parent
c5b3181ad9
commit
1e20b80a91
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
Fri Feb 20 17:49:22 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
|
Fix a few leaks
|
||||||
|
|
||||||
|
* qemud/qemud.c: qemudCleanup(): free the socket
|
||||||
|
structures
|
||||||
|
|
||||||
|
* qemud/conf.c: fix various leaks in the xml parsing
|
||||||
|
|
||||||
|
* qemud/iptables.c: fix a typo causing a leak
|
||||||
|
|
||||||
Fri Feb 20 16:49:53 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
Fri Feb 20 16:49:53 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
* qemud/conf.c, qemud/qemud.c: only create config dirs
|
* qemud/conf.c, qemud/qemud.c: only create config dirs
|
||||||
|
@ -328,6 +328,11 @@ int virConnectListDefinedDomains (virConnectPtr conn,
|
|||||||
int maxnames);
|
int maxnames);
|
||||||
int virDomainCreate (virDomainPtr domain);
|
int virDomainCreate (virDomainPtr domain);
|
||||||
|
|
||||||
|
int virDomainGetAutostart (virDomainPtr domain,
|
||||||
|
int *autostart);
|
||||||
|
int virDomainSetAutostart (virDomainPtr domain,
|
||||||
|
int autostart);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* virVcpuInfo: structure for information about a virtual CPU in a domain.
|
* virVcpuInfo: structure for information about a virtual CPU in a domain.
|
||||||
*/
|
*/
|
||||||
@ -528,6 +533,11 @@ char * virNetworkGetXMLDesc (virNetworkPtr network,
|
|||||||
int flags);
|
int flags);
|
||||||
char * virNetworkGetBridgeName (virNetworkPtr network);
|
char * virNetworkGetBridgeName (virNetworkPtr network);
|
||||||
|
|
||||||
|
int virNetworkGetAutostart (virNetworkPtr network,
|
||||||
|
int *autostart);
|
||||||
|
int virNetworkSetAutostart (virNetworkPtr network,
|
||||||
|
int autostart);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -651,6 +651,7 @@ static struct qemud_vm_def *qemudParseXML(struct qemud_server *server,
|
|||||||
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) {
|
(obj->nodesetval != NULL) && (obj->nodesetval->nodeNr == 1)) {
|
||||||
def->features |= QEMUD_FEATURE_ACPI;
|
def->features |= QEMUD_FEATURE_ACPI;
|
||||||
}
|
}
|
||||||
|
xmlXPathFreeObject(obj);
|
||||||
|
|
||||||
/* Extract OS type info */
|
/* Extract OS type info */
|
||||||
obj = xmlXPathEval(BAD_CAST "string(/domain/os/type[1])", ctxt);
|
obj = xmlXPathEval(BAD_CAST "string(/domain/os/type[1])", ctxt);
|
||||||
@ -794,8 +795,7 @@ static struct qemud_vm_def *qemudParseXML(struct qemud_server *server,
|
|||||||
if ((obj == NULL) || (obj->type != XPATH_NODESET) ||
|
if ((obj == NULL) || (obj->type != XPATH_NODESET) ||
|
||||||
(obj->nodesetval == NULL) || (obj->nodesetval->nodeNr == 0)) {
|
(obj->nodesetval == NULL) || (obj->nodesetval->nodeNr == 0)) {
|
||||||
def->graphicsType = QEMUD_GRAPHICS_NONE;
|
def->graphicsType = QEMUD_GRAPHICS_NONE;
|
||||||
} else {
|
} else if ((prop = xmlGetProp(obj->nodesetval->nodeTab[0], BAD_CAST "type"))) {
|
||||||
prop = xmlGetProp(obj->nodesetval->nodeTab[0], BAD_CAST "type");
|
|
||||||
if (!strcmp((char *)prop, "vnc")) {
|
if (!strcmp((char *)prop, "vnc")) {
|
||||||
def->graphicsType = QEMUD_GRAPHICS_VNC;
|
def->graphicsType = QEMUD_GRAPHICS_VNC;
|
||||||
prop = xmlGetProp(obj->nodesetval->nodeTab[0], BAD_CAST "port");
|
prop = xmlGetProp(obj->nodesetval->nodeTab[0], BAD_CAST "port");
|
||||||
@ -811,7 +811,9 @@ static struct qemud_vm_def *qemudParseXML(struct qemud_server *server,
|
|||||||
qemudReportError(server, VIR_ERR_INTERNAL_ERROR, "Unsupported graphics type %s", prop);
|
qemudReportError(server, VIR_ERR_INTERNAL_ERROR, "Unsupported graphics type %s", prop);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
xmlFree(prop);
|
||||||
}
|
}
|
||||||
|
xmlXPathFreeObject(obj);
|
||||||
|
|
||||||
/* analysis of the disk devices */
|
/* analysis of the disk devices */
|
||||||
obj = xmlXPathEval(BAD_CAST "/domain/devices/disk", ctxt);
|
obj = xmlXPathEval(BAD_CAST "/domain/devices/disk", ctxt);
|
||||||
|
@ -231,8 +231,8 @@ static void
|
|||||||
iptRulesFree(iptRules *rules)
|
iptRulesFree(iptRules *rules)
|
||||||
{
|
{
|
||||||
if (rules->table) {
|
if (rules->table) {
|
||||||
free(rules->chain);
|
free(rules->table);
|
||||||
rules->chain = NULL;
|
rules->table = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rules->chain) {
|
if (rules->chain) {
|
||||||
|
@ -1483,16 +1483,23 @@ static int qemudRunLoop(struct qemud_server *server, int timeout) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void qemudCleanup(struct qemud_server *server) {
|
static void qemudCleanup(struct qemud_server *server) {
|
||||||
struct qemud_socket *sock = server->sockets;
|
struct qemud_socket *sock;
|
||||||
|
|
||||||
close(server->sigread);
|
close(server->sigread);
|
||||||
|
|
||||||
|
sock = server->sockets;
|
||||||
while (sock) {
|
while (sock) {
|
||||||
|
struct qemud_socket *next = sock->next;
|
||||||
close(sock->fd);
|
close(sock->fd);
|
||||||
sock = sock->next;
|
free(sock);
|
||||||
|
sock = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (server->brctl)
|
if (server->brctl)
|
||||||
brShutdown(server->brctl);
|
brShutdown(server->brctl);
|
||||||
if (server->iptables)
|
if (server->iptables)
|
||||||
iptablesContextFree(server->iptables);
|
iptablesContextFree(server->iptables);
|
||||||
|
|
||||||
free(server);
|
free(server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user