string: Set result pointer to NULL on errors.
authorAndre Noll <maan@systemlinux.org>
Sun, 28 Aug 2011 04:35:37 +0000 (06:35 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 3 Sep 2011 14:40:37 +0000 (16:40 +0200)
...and be strict in what you return.

string.c

index b16109c..0a32c0f 100644 (file)
--- a/string.c
+++ b/string.c
@@ -762,6 +762,7 @@ err:
        while (num_words > 0)
                free(argv[--num_words]);
        free(argv);
        while (num_words > 0)
                free(argv[--num_words]);
        free(argv);
+       *result = NULL;
        return ret;
 }
 
        return ret;
 }