Commit 0c28c72d by Patrick Steinhardt

fileops: check return value of `git_path_dirname`

parent dd0aa811
...@@ -1155,9 +1155,13 @@ int git_futils_fsync_dir(const char *path) ...@@ -1155,9 +1155,13 @@ int git_futils_fsync_dir(const char *path)
int git_futils_fsync_parent(const char *path) int git_futils_fsync_parent(const char *path)
{ {
char *parent = git_path_dirname(path); char *parent;
int error = git_futils_fsync_dir(parent); int error;
if ((parent = git_path_dirname(path)) == NULL)
return -1;
error = git_futils_fsync_dir(parent);
git__free(parent); git__free(parent);
return error; return error;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment