summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-01-19 23:44:52 +0100
committerCarlos Martín Nieto <carlos@cmartin.tk>2012-01-19 23:47:15 +0100
commit9269ccce143578deec4d4e6e7755068f130abe96 (patch)
tree753e89b85df6cee2e5545c88084da7ecba2e5613 /src
parent860de00459dd06c3758fdfc3db8bdd6978b6073c (diff)
downloadlibgit2-9269ccce143578deec4d4e6e7755068f130abe96.tar.gz
diff-index: fix leak
The buffer wasn't getting freed if the last difference was a deletion.
Diffstat (limited to 'src')
-rw-r--r--src/transports/http.c2
-rw-r--r--src/tree.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/transports/http.c b/src/transports/http.c
index ce68ab717..38446bdef 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -71,7 +71,7 @@ static int gen_request(git_buf *buf, const char *url, const char *host, const ch
if (content_length > 0) {
git_buf_printf(buf, "Accept: application/x-git-%s-result\r\n", service);
git_buf_printf(buf, "Content-Type: application/x-git-%s-request\r\n", service);
- git_buf_printf(buf, "Content-Length: %" PRIuZ "\r\n", content_length);
+ git_buf_printf(buf, "Content-Length: %"PRIuZ "\r\n", content_length);
} else {
git_buf_puts(buf, "Accept: */*\r\n");
}
diff --git a/src/tree.c b/src/tree.c
index f21490235..373d82b3a 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -993,6 +993,7 @@ static int diff_index_cb(const char *root, git_tree_entry *tentry, void *data)
if (!ientry) {
error = signal_deletion(tentry, cbdata->cb, cbdata->data);
+ git_buf_free(&fn_buf);
goto exit;
}