summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nxt_fs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/nxt_fs.c b/src/nxt_fs.c
index 0d10f623..6a93c670 100644
--- a/src/nxt_fs.c
+++ b/src/nxt_fs.c
@@ -58,11 +58,14 @@ nxt_fs_mkdir_dirname(const u_char *path, mode_t mode)
ret = NXT_OK;
ptr = strrchr(dir, '/');
- if (nxt_fast_path(ptr != NULL)) {
- *ptr = '\0';
- ret = nxt_fs_mkdir((const u_char *) dir, mode);
+ if (nxt_slow_path(ptr == NULL)) {
+ goto out_free;
}
+ *ptr = '\0';
+ ret = nxt_fs_mkdir((const u_char *) dir, mode);
+
+out_free:
nxt_free(dir);
return ret;