X-Git-Url: https://git.octo.it/?p=collection4.git;a=blobdiff_plain;f=src%2Frrd_args.c;h=f9137332276faf7a7fb89d3d86035f99b162deaf;hp=f5358c8bbc8cdda2add775b6e67799c3ec777d60;hb=8a3753760230b270c8f4615891cba2586a661d21;hpb=b7d53a7bc78730802b99d089caa063ea78a7ce8e diff --git a/src/rrd_args.c b/src/rrd_args.c index f5358c8..f913733 100644 --- a/src/rrd_args.c +++ b/src/rrd_args.c @@ -75,6 +75,7 @@ char **ra_argv (rrd_args_t *ra) /* {{{ */ return (NULL); pos = 0; + argv[0] = NULL; #define APPEND_FIELD(field) do \ { \ @@ -89,7 +90,6 @@ char **ra_argv (rrd_args_t *ra) /* {{{ */ pos += ary_argc; \ argv[pos] = NULL; \ } \ - free (ary_argv); \ } while (0) APPEND_FIELD (options); @@ -102,4 +102,12 @@ char **ra_argv (rrd_args_t *ra) /* {{{ */ return (argv); } /* }}} char **ra_argv */ +void ra_argv_free (char **argv) /* {{{ */ +{ + /* The pointers contained in the "argv" come from "array_argv". We don't need + * to free them. We only need to free what we actually alloced directly in + * "ra_argv". */ + free (argv); +} /* }}} void ra_argv_free */ + /* vim: set sw=2 sts=2 et fdm=marker : */