summaryrefslogtreecommitdiff
path: root/src/oid.c
diff options
context:
space:
mode:
authorBrodie Rao <brodie@sf.io>2014-01-12 23:31:35 -0800
committerBrodie Rao <brodie@sf.io>2014-01-12 23:34:02 -0800
commit32b7e84ec09170761bf9422cc4139be0b14975a9 (patch)
treef6032fd67de02b4236d1118ca222f666d5a56a4a /src/oid.c
parentae3b6d612db6305a20e1139503b3c9e99cf4632a (diff)
downloadlibgit2-32b7e84ec09170761bf9422cc4139be0b14975a9.tar.gz
oid: handle NULL pointers passed to git_oid_shorten_free()
Signed-off-by: Brodie Rao <brodie@sf.io>
Diffstat (limited to 'src/oid.c')
-rw-r--r--src/oid.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/oid.c b/src/oid.c
index d56b6af24..567b6cf06 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -314,6 +314,9 @@ git_oid_shorten *git_oid_shorten_new(size_t min_length)
void git_oid_shorten_free(git_oid_shorten *os)
{
+ if (os == NULL)
+ return;
+
git__free(os->nodes);
git__free(os);
}