summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrodie Rao <brodie@sf.io>2014-01-12 23:32:10 -0800
committerBrodie Rao <brodie@sf.io>2014-01-12 23:34:09 -0800
commit2fcc0d07d050a6d70d85c510cef7aea4845e340f (patch)
tree25db49a185a24297638a4a3542de43532e89a15d
parent2ad45213a84a5e3948557edcb3a76bc439f8b61e (diff)
downloadlibgit2-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.c4
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]);