X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=blobdiff_plain;f=src%2Frrd_flushcached.c;h=5d18a1e211549e948f863c978771dbf2c1787bf8;hp=f7a715e110c85528ae991decff7ea10a8eecd5a7;hb=efd1e552c995d417113ab843edbc9f2974eeb20d;hpb=9e56458803c05e1b98591818412a08ffcf3f0401 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 */