forked from lda/telodendria
Fix some bugs in DbCreate() regarding UtilMkdir()
This commit is contained in:
parent
789baf33a1
commit
40e5c1ef2a
1 changed files with 3 additions and 1 deletions
4
src/Db.c
4
src/Db.c
|
@ -495,7 +495,7 @@ DbCreate(Db * db, size_t nArgs,...)
|
||||||
|
|
||||||
file = DbFileName(db, args);
|
file = DbFileName(db, args);
|
||||||
|
|
||||||
if (UtilLastModified(file) || UtilMkdir(dir, 0750) < 0)
|
if (UtilLastModified(file))
|
||||||
{
|
{
|
||||||
Free(file);
|
Free(file);
|
||||||
ArrayFree(args);
|
ArrayFree(args);
|
||||||
|
@ -511,6 +511,8 @@ DbCreate(Db * db, size_t nArgs,...)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Free(dir);
|
||||||
|
|
||||||
fp = fopen(file, "w");
|
fp = fopen(file, "w");
|
||||||
Free(file);
|
Free(file);
|
||||||
if (!fp)
|
if (!fp)
|
||||||
|
|
Loading…
Reference in a new issue