From f7e3e54ccb3255ea545ca8dc786ee05d64fd754a Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sun, 21 Oct 2018 11:09:20 +0200 Subject: [PATCH] file: last fix for dir creation --- lib/nodes/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/nodes/file.c b/lib/nodes/file.c index c54ba20a1..14cee06bd 100644 --- a/lib/nodes/file.c +++ b/lib/nodes/file.c @@ -214,7 +214,8 @@ int file_start(struct node *n) /* Check if directory exists */ struct stat sb; - char *dir = dirname(f->uri); + char *cpy = strdup(f->uri); + char *dir = dirname(cpy); ret = stat(dir, &sb); if (ret) { @@ -232,6 +233,8 @@ int file_start(struct node *n) serror("Failed to create directory"); } + free(cpy); + /* Open file */ flags = SAMPLE_HAS_ALL; if (f->flush)