From 40e5c1ef2ad57b3941ca40ac4cf0ccb5eaf04c24 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Mon, 21 Nov 2022 20:59:22 +0000 Subject: [PATCH] Fix some bugs in DbCreate() regarding UtilMkdir() --- src/Db.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Db.c b/src/Db.c index 7c3f5fd..a9fd9ea 100644 --- a/src/Db.c +++ b/src/Db.c @@ -495,7 +495,7 @@ DbCreate(Db * db, size_t nArgs,...) file = DbFileName(db, args); - if (UtilLastModified(file) || UtilMkdir(dir, 0750) < 0) + if (UtilLastModified(file)) { Free(file); ArrayFree(args); @@ -511,6 +511,8 @@ DbCreate(Db * db, size_t nArgs,...) return NULL; } + Free(dir); + fp = fopen(file, "w"); Free(file); if (!fp)