mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-28 04:29:42 +00:00
fileops: check return value of git_path_dirname
This commit is contained in:
parent
dd0aa811dd
commit
0c28c72d13
@ -1155,9 +1155,13 @@ int git_futils_fsync_dir(const char *path)
|
||||
|
||||
int git_futils_fsync_parent(const char *path)
|
||||
{
|
||||
char *parent = git_path_dirname(path);
|
||||
int error = git_futils_fsync_dir(parent);
|
||||
char *parent;
|
||||
int error;
|
||||
|
||||
if ((parent = git_path_dirname(path)) == NULL)
|
||||
return -1;
|
||||
|
||||
error = git_futils_fsync_dir(parent);
|
||||
git__free(parent);
|
||||
return error;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user