summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-03-22 12:47:53 +0100
committerVicent Marti <tanoku@gmail.com>2011-03-22 20:37:34 +0200
commit567fc1d20c734c34dd1c4c19be12abcc1622aa5d (patch)
tree37dd7d90ea1e0fc823fa95eb7737dcea48c572fe
parent70236bab2d64a4d34203b4e2bbc5d8f518ba618d (diff)
downloadlibgit2-567fc1d20c734c34dd1c4c19be12abcc1622aa5d.tar.gz
refs loose_lookup: also free the buffer on success
Free the ref_file buffer at the end of the function also on success. This fixes a small memory leak.
-rw-r--r--src/refs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/refs.c b/src/refs.c
index 40b80ec9b..8e2965528 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -333,6 +333,7 @@ static int loose_lookup(
ref->mtime = ref_time;
*ref_out = ref;
+ gitfo_free_buf(&ref_file);
return GIT_SUCCESS;
cleanup: