summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-04-21 15:48:05 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-04-21 15:48:05 +0200
commita15d3537bb52450f75ad63642b6bcbbcc6fdc374 (patch)
tree5b2e7d1d1b6052dfbe04bb5ea0f64ee56d0ad1f5
parentbfc50f83f829afe52c10f615c4f7efa478a83098 (diff)
downloadlibgit2-a15d3537bb52450f75ad63642b6bcbbcc6fdc374.tar.gz
sysdir: free the path if we cannot find the file
Returning an error cleared the buf, but this operation does not free the memory associated with it. Use git_buf_free() instead.
-rw-r--r--src/sysdir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sysdir.c b/src/sysdir.c
index 2e6304e35..aebf23135 100644
--- a/src/sysdir.c
+++ b/src/sysdir.c
@@ -213,7 +213,7 @@ static int git_sysdir_find_in_dirlist(
return 0;
}
- git_buf_clear(path);
+ git_buf_free(path);
giterr_set(GITERR_OS, "The %s file '%s' doesn't exist", label, name);
return GIT_ENOTFOUND;
}