mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-27 21:57:07 +00:00
path: handle error returned by git_buf_joinpath
In the `_check_dir_contents` function, we first allocate memory for joining the directory and subdirectory together and afterwards use `git_buf_joinpath`. While this function in fact should not fail as memory is already allocated, err on the safe side and check for returned errors.
This commit is contained in:
parent
4467aeac42
commit
cffd616a72
@ -700,7 +700,8 @@ static bool _check_dir_contents(
|
||||
return false;
|
||||
|
||||
/* save excursion */
|
||||
git_buf_joinpath(dir, dir->ptr, sub);
|
||||
if (git_buf_joinpath(dir, dir->ptr, sub) < 0)
|
||||
return false;
|
||||
|
||||
result = predicate(dir->ptr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user