Fix some bugs in DbCreate() regarding UtilMkdir()

This commit is contained in:
Jordan Bancino 2022-11-21 20:59:22 +00:00
parent 789baf33a1
commit 40e5c1ef2a

View file

@ -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)