diff options
author | Brodie Rao <brodie@sf.io> | 2014-01-12 23:32:10 -0800 |
---|---|---|
committer | Brodie Rao <brodie@sf.io> | 2014-01-12 23:34:09 -0800 |
commit | 2fcc0d07d050a6d70d85c510cef7aea4845e340f (patch) | |
tree | 25db49a185a24297638a4a3542de43532e89a15d | |
parent | 2ad45213a84a5e3948557edcb3a76bc439f8b61e (diff) | |
download | libgit2-2fcc0d07d050a6d70d85c510cef7aea4845e340f.tar.gz |
util: handle NULL pointers passed to git_strarray_free()
Signed-off-by: Brodie Rao <brodie@sf.io>
-rw-r--r-- | src/util.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c index 81a64c702..f977a9bb1 100644 --- a/src/util.c +++ b/src/util.c @@ -140,6 +140,10 @@ int git_libgit2_opts(int key, ...) void git_strarray_free(git_strarray *array) { size_t i; + + if (array == NULL) + return; + for (i = 0; i < array->count; ++i) git__free(array->strings[i]); |