check mkdir results (coverity 1109838)
This commit is contained in:
parent
e197abf63a
commit
17b347a260
|
@ -457,13 +457,20 @@ char *container_extract_theme(const char *themefile, const char *dirbasename)
|
|||
strcpy(dirname, dirbasename);
|
||||
strcat(dirname, themename);
|
||||
if (stat(dirname, &statbuf) != -1) {
|
||||
/* directory exists */
|
||||
warn_user("DirectoryError", dirname);
|
||||
container_close(cctx);
|
||||
free(dirname);
|
||||
free(themename);
|
||||
return NULL;
|
||||
}
|
||||
if (mkdir(dirname, S_IRWXU) != 0) {
|
||||
warn_user("DirectoryError", dirname);
|
||||
container_close(cctx);
|
||||
free(dirname);
|
||||
free(themename);
|
||||
return NULL;
|
||||
}
|
||||
mkdir(dirname, S_IRWXU);
|
||||
|
||||
for (e = container_iterate(cctx, &state), i = 0; i < cctx->entries;
|
||||
e = container_iterate(cctx, &state), i++) {
|
||||
|
|
Loading…
Reference in New Issue