mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
libvirtd: avoid memory leak on OOM
Detected by Coverity; only strikes on OOM so not serious. * daemon/libvirtd.c (daemonPidFilePath): Plug leak.
This commit is contained in:
parent
5d382c57a1
commit
e07e9a9456
@ -310,8 +310,10 @@ daemonPidFilePath(bool privileged,
|
||||
if (!(userdir = virGetUserDirectory(geteuid())))
|
||||
goto error;
|
||||
|
||||
if (virAsprintf(pidfile, "%s/.libvirt/libvirtd.pid", userdir) < 0)
|
||||
if (virAsprintf(pidfile, "%s/.libvirt/libvirtd.pid", userdir) < 0) {
|
||||
VIR_FREE(userdir);
|
||||
goto no_memory;
|
||||
}
|
||||
|
||||
VIR_FREE(userdir);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user