]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_list.c: fix local directory listing when connection to rrdcached fails 737/head
authorMarek Schimara <Marek.Schimara@bull.net>
Wed, 7 Sep 2016 12:24:21 +0000 (14:24 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Wed, 7 Sep 2016 12:41:54 +0000 (14:41 +0200)
        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

src/rrd_list.c

index 98771c6f6e4fb93f1b3296b3dc8cddbd66e80920..8a1c7f64b494657bc585bd4fb0c17d575f216090 100644 (file)
@@ -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]);