mirror of
https://github.com/libvirt/libvirt.git
synced 2026-07-31 16:48:21 -05: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:
+2
-2
@@ -980,8 +980,8 @@ void virLogSetFromEnv(void) {
|
||||
virLogParseDefaultPriority(debugEnv);
|
||||
debugEnv = getenv("LIBVIRT_LOG_FILTERS");
|
||||
if (debugEnv && *debugEnv)
|
||||
virLogParseFilters(strdup(debugEnv));
|
||||
virLogParseFilters(debugEnv);
|
||||
debugEnv = getenv("LIBVIRT_LOG_OUTPUTS");
|
||||
if (debugEnv && *debugEnv)
|
||||
virLogParseOutputs(strdup(debugEnv));
|
||||
virLogParseOutputs(debugEnv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user