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 bbb7c7d..b16109c 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);