From a15d3537bb52450f75ad63642b6bcbbcc6fdc374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 21 Apr 2014 15:48:05 +0200 Subject: [PATCH] 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. --- src/sysdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }