]> git.tue.mpg.de Git - paraslash.git/commitdiff
string: Allow passing NULL to free_argv().
authorAndre Noll <maan@systemlinux.org>
Fri, 26 Aug 2011 23:47:13 +0000 (01:47 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 3 Sep 2011 14:40:36 +0000 (16:40 +0200)
After all, free() also allows NULL pointers. Be liberal in what you
accept...

string.c

index bbb7c7dd2e2ef671d2b89d5a5cebd89e535066d5..b16109ca759f7e4cc6b9952c1ec9f2aaac1598c4 100644 (file)
--- a/string.c
+++ b/string.c
@@ -719,6 +719,8 @@ void free_argv(char **argv)
 {
        int i;
 
+       if (!argv)
+               return;
        for (i = 0; argv[i]; i++)
                free(argv[i]);
        free(argv);