mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
libvirtd: avoid leak on failure
Spotted by Coverity. Only possible on an OOM condition, so unlikely to bite in the wild. * daemon/libvirtd.c (qemudSetLogging): Don't leak memory.
This commit is contained in:
parent
bb8895290c
commit
ef21bedaf9
@ -2779,9 +2779,11 @@ qemudSetLogging(struct qemud_server *server, virConfPtr conf,
|
|||||||
goto free_and_fail;
|
goto free_and_fail;
|
||||||
|
|
||||||
if (virAsprintf(&tmp, "%d:file:%s/.libvirt/libvirtd.log",
|
if (virAsprintf(&tmp, "%d:file:%s/.libvirt/libvirtd.log",
|
||||||
virLogGetDefaultPriority(), userdir) == -1)
|
virLogGetDefaultPriority(), userdir) == -1) {
|
||||||
|
VIR_FREE(userdir);
|
||||||
goto out_of_memory;
|
goto out_of_memory;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (virAsprintf(&tmp, "%d:stderr", virLogGetDefaultPriority()) < 0)
|
if (virAsprintf(&tmp, "%d:stderr", virLogGetDefaultPriority()) < 0)
|
||||||
goto out_of_memory;
|
goto out_of_memory;
|
||||||
|
Loading…
Reference in New Issue
Block a user