Skip to content

Commit

Permalink
cfgt: check error case for mkdir()
Browse files Browse the repository at this point in the history
(cherry picked from commit 9a7fee2)
  • Loading branch information
miconda committed Aug 30, 2017
1 parent 4b43735 commit f3f388d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/modules/cfgt/cfgt_int.c
Expand Up @@ -362,7 +362,10 @@ void cfgt_save_node(cfgt_node_p node)
return;
}
LM_DBG("dir [%s]\n", dest.s);
mkdir(dest.s, S_IRWXO|S_IXGRP|S_IRWXU);
if(mkdir(dest.s, S_IRWXO|S_IXGRP|S_IRWXU)<0) {
LM_ERR("failed to make directory (%d)\n", errno);
return;
}
dest.s[dir] = '/';
fp = fopen(dest.s, "w");
LM_DBG("file [%s]\n", dest.s);
Expand Down

0 comments on commit f3f388d

Please sign in to comment.