summaryrefslogtreecommitdiff
path: root/src/stream.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-10-13 19:34:07 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-11-03 08:10:14 -0800
commitd39f643a0a09336ad77f04b7037cbc1c486bdd50 (patch)
tree9bf20881830b736547fbf2cd742938d9009ad368 /src/stream.h
parentd07c9f4d2a59dbd423c155b0e74fdeb3c88ea4b9 (diff)
downloadlibgit2-d39f643a0a09336ad77f04b7037cbc1c486bdd50.tar.gz
stream: accept NULL in the free function
Diffstat (limited to 'src/stream.h')
-rw-r--r--src/stream.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/stream.h b/src/stream.h
index 43fcc3045..4692c7115 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -62,6 +62,9 @@ GIT_INLINE(int) git_stream_close(git_stream *st)
GIT_INLINE(void) git_stream_free(git_stream *st)
{
+ if (!st)
+ return;
+
st->free(st);
}