mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 22:55:23 +00:00
Fix memory leak in logging setup
The logging setup requires const char * strings, but the virLogSetFromEnv() strdup's the env variables, thus causing a memory leak * src/util/logging.c: Avoid strdup'ing env variables
This commit is contained in:
parent
6fda7ea537
commit
c846bc9eb8
@ -980,8 +980,8 @@ void virLogSetFromEnv(void) {
|
|||||||
virLogParseDefaultPriority(debugEnv);
|
virLogParseDefaultPriority(debugEnv);
|
||||||
debugEnv = getenv("LIBVIRT_LOG_FILTERS");
|
debugEnv = getenv("LIBVIRT_LOG_FILTERS");
|
||||||
if (debugEnv && *debugEnv)
|
if (debugEnv && *debugEnv)
|
||||||
virLogParseFilters(strdup(debugEnv));
|
virLogParseFilters(debugEnv);
|
||||||
debugEnv = getenv("LIBVIRT_LOG_OUTPUTS");
|
debugEnv = getenv("LIBVIRT_LOG_OUTPUTS");
|
||||||
if (debugEnv && *debugEnv)
|
if (debugEnv && *debugEnv)
|
||||||
virLogParseOutputs(strdup(debugEnv));
|
virLogParseOutputs(debugEnv);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user