From efd1e552c995d417113ab843edbc9f2974eeb20d Mon Sep 17 00:00:00 2001 From: oetiker Date: Sun, 4 Oct 2009 11:34:00 +0000 Subject: [PATCH] rrdflushcached: Do not free 'opt_daemon' before checking the connection. -- Sebastian Harl git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1927 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_flushcached.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rrd_flushcached.c b/src/rrd_flushcached.c index f7a715e..5d18a1e 100644 --- a/src/rrd_flushcached.c +++ b/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 */ -- 2.30.2