[PATCH] rrdflushcached: Do not free 'opt_daemon' before checking the connection.

2 messages Options
Embed this post
Permalink
Sebastian Harl

[PATCH] rrdflushcached: Do not free 'opt_daemon' before checking the connection.

Reply Threaded More More options
Print post
Permalink
---
 program/src/rrd_flushcached.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/program/src/rrd_flushcached.c b/program/src/rrd_flushcached.c
index f7a715e..5d18a1e 100644
--- a/program/src/rrd_flushcached.c
+++ b/program/src/rrd_flushcached.c
@@ -74,7 +74,6 @@ int rrd_flushcached (int argc, char **argv)
 
     /* try to connect to rrdcached */
     status = rrdc_connect(opt_daemon);
-    if (opt_daemon) free(opt_daemon);
     if (status != 0) return status;
 
     if (! rrdc_is_connected(opt_daemon))
@@ -107,6 +106,8 @@ int rrd_flushcached (int argc, char **argv)
         }
     }
 
+    if (opt_daemon) free(opt_daemon);
+
     return ((status == 0) ? 0 : -1);
 } /* int rrd_flush */
 
--
1.6.5.rc2



_______________________________________________
rrd-developers mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers

signature.asc (204 bytes) Download Attachment
oetiker

Re: [PATCH] rrdflushcached: Do not free 'opt_daemon' before checking the connection.

Reply Threaded More More options
Print post
Permalink
Hi Sebastian,

Yesterday Sebastian Harl wrote:

> ---
>  program/src/rrd_flushcached.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

thanks
applied
tobi


--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch [hidden email] ++41 62 775 9902 / sb: -9900

_______________________________________________
rrd-developers mailing list
[hidden email]
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers