summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-05-14 17:26:09 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-14 17:26:09 +0200
commit542a7de0cdbed72f04a30db6f3ed1352b2169381 (patch)
tree3f8b8b1e798773e521f0deacf7fe8e5bbab2ea2b
parent4a6a67461d5c437ee4bde099593f8483933b641e (diff)
downloadlibgit2-542a7de0cdbed72f04a30db6f3ed1352b2169381.tar.gz
local: plug a leak in the progress reporting
-rw-r--r--src/transports/local.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/transports/local.c b/src/transports/local.c
index 3b031a519..1c6e5f01e 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -474,6 +474,7 @@ static int local_counting(int stage, unsigned int current, unsigned int total, v
{
git_buf progress_info = GIT_BUF_INIT;
transport_local *t = payload;
+ int error;
if (!t->progress_cb)
return 0;
@@ -493,7 +494,10 @@ static int local_counting(int stage, unsigned int current, unsigned int total, v
if (git_buf_oom(&progress_info))
return -1;
- return t->progress_cb(git_buf_cstr(&progress_info), git_buf_len(&progress_info), t->message_cb_payload);
+ error = t->progress_cb(git_buf_cstr(&progress_info), git_buf_len(&progress_info), t->message_cb_payload);
+ git_buf_free(&progress_info);
+
+ return error;
}
static int local_download_pack(