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.
diff --git a/src/sysdir.c b/src/sysdir.c
index 2e6304e..aebf231 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;
}