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.
This commit is contained in:
Carlos Martín Nieto 2014-04-21 15:48:05 +02:00
parent bfc50f83f8
commit a15d3537bb

View File

@ -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;
}