mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 23:26:39 +00:00
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:
parent
bfc50f83f8
commit
a15d3537bb
@ -213,7 +213,7 @@ static int git_sysdir_find_in_dirlist(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
git_buf_clear(path);
|
git_buf_free(path);
|
||||||
giterr_set(GITERR_OS, "The %s file '%s' doesn't exist", label, name);
|
giterr_set(GITERR_OS, "The %s file '%s' doesn't exist", label, name);
|
||||||
return GIT_ENOTFOUND;
|
return GIT_ENOTFOUND;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user