From: Marek Schimara Date: Wed, 7 Sep 2016 12:24:21 +0000 (+0200) Subject: src/rrd_list.c: fix local directory listing when connection to rrdcached fails X-Git-Tag: v1.7.0~34^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F737%2Fhead;p=thirdparty%2Frrdtool-1.x.git src/rrd_list.c: fix local directory listing when connection to rrdcached fails Without this fix, when the remote rrdcached cannot be reached and a path that exists on the local machine (such as '/') is asked for, 'list' returns 'ls' of the local path. Example of erroneous output: $ rrdtool list -d rrdcached-host:42222 / Error connecting to rrdcached: Unable to connect to rrdcached: Connection refused var storage lib sysroot rules.d lib64 backup opt bin sbin boot proc usr dev sys srv mnt run etc media tmp home root ERROR: Unable to connect to rrdcached: Connection refused --- diff --git a/src/rrd_list.c b/src/rrd_list.c index 98771c6f..8a1c7f64 100644 --- a/src/rrd_list.c +++ b/src/rrd_list.c @@ -246,6 +246,9 @@ char *rrd_list(int argc, char **argv) if (err) fprintf(stderr, ": %s", err); fprintf(stderr, "\n"); + + free(opt_daemon); + return NULL; } list = rrd_list_r(argv[options.optind]);