]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Linux: fix a memory leak when dhcpcd exits or the log is reopened origin/HEAD origin/master
authorRoy Marples <roy@marples.name>
Sun, 24 Jan 2021 22:53:20 +0000 (22:53 +0000)
committerRoy Marples <roy@marples.name>
Sun, 24 Jan 2021 22:53:20 +0000 (22:53 +0000)
src/logerr.c

index 21e933b898d391c03a6d422558d1daec0f708507..35268870bb6c9dcd1fafef35637871d0fa585c79 100644 (file)
@@ -484,13 +484,14 @@ logclose(void)
 #endif
 
        closelog();
+#if defined(__linux__)
+       free(_logprog);
+       _logprog = NULL;
+#endif
 #ifndef SMALL
        if (ctx->log_file == NULL)
                return;
        fclose(ctx->log_file);
        ctx->log_file = NULL;
 #endif
-#if defined(__linux__)
-       free(_logprog);
-#endif
 }