daemon: fix memory leak in daemonUnixSocketPaths

@rundir, allocated by virGetUserRuntimeDirectory, is leaked in case
virFileMakePath fails.

Signed-off-by: Xi Xu <xu.xi8@zte.com.cn>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Yi Wang 2017-06-12 02:02:20 -04:00 committed by Erik Skultety
parent 5c8c2d1633
commit 2502a0fade

View File

@ -288,6 +288,7 @@ daemonUnixSocketPaths(struct daemonConfig *config,
old_umask = umask(077);
if (virFileMakePath(rundir) < 0) {
umask(old_umask);
VIR_FREE(rundir);
goto error;
}
umask(old_umask);