[rrd-developers] [PATCH] rrdcached: Free the pid_file *after* removing it.

Sebastian Harl sh at tokkee.org
Sat Sep 26 13:21:30 CEST 2009


Else, the daemon might either segfault or leave the PID file around.
---
 program/src/rrd_daemon.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/program/src/rrd_daemon.c b/program/src/rrd_daemon.c
index 308d3b6..710fa01 100644
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
@@ -2677,7 +2677,6 @@ static int cleanup (void) /* {{{ */
 
   free(queue_threads);
   free(config_base_dir);
-  free(config_pid_file);
 
   pthread_mutex_lock(&cache_lock);
   g_tree_destroy(cache_tree);
@@ -2689,6 +2688,7 @@ static int cleanup (void) /* {{{ */
   closelog ();
 
   remove_pidfile ();
+  free(config_pid_file);
 
   return (0);
 } /* }}} int cleanup */
-- 
1.6.5.rc2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20090926/f1634cd3/attachment.pgp 


More information about the rrd-developers mailing list