[libvirt] [PATCH] Fix openlog() ident usage

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# HG changeset patch
# User john.levon@xxxxxxx
# Date 1232478815 28800
# Node ID 37a6a671e38d7f4449d3b47bc5cf06c19362bc41
# Parent  15bfba92a98744f8c554757ed608c3bf89fa38aa
Fix openlog() ident usage

It cannot be freed, as it's used by reference in the syslog code, at
least on Solaris.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/src/logging.c b/src/logging.c
--- a/src/logging.c
+++ b/src/logging.c
@@ -705,7 +705,10 @@ int virLogParseOutputs(const char *outpu
                 return(-1);
             if (virLogAddOutputToSyslog(prio, name) == 0)
                 ret++;
-            VIR_FREE(name);
+            /*
+             * Do *NOT* free(name) - openlog() uses this string by
+             * reference, instead of keeping its own copy.
+	     */
 #endif /* HAVE_SYSLOG_H */
         } else if (STREQLEN(cur, "file", 4)) {
             cur += 4;

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]