mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
Fix leak on OOM in qemuMonitorCommonTestNew
Don't leak the path string in qemuMonitorCommonTestNew if an OOM occurs. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
4f2094346d
commit
92f8c3fc71
@ -793,6 +793,7 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt,
|
||||
src->type = VIR_DOMAIN_CHR_TYPE_UNIX;
|
||||
src->data.nix.path = (char *)path;
|
||||
src->data.nix.listen = false;
|
||||
path = NULL;
|
||||
|
||||
if (virNetSocketListen(test->server, 1) < 0)
|
||||
goto error;
|
||||
@ -801,6 +802,7 @@ cleanup:
|
||||
return test;
|
||||
|
||||
error:
|
||||
VIR_FREE(path);
|
||||
VIR_FREE(tmpdir_template);
|
||||
qemuMonitorTestFree(test);
|
||||
test = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user