Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r--source/blender/blenlib/intern/fileops.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 413c2007b1b..bb218995c83 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -357,7 +357,12 @@ void *BLI_gzopen(const char *filename, const char *mode)
/* xxx Creates file before transcribing the path */
if (mode[0] == 'w') {
- fclose(ufopen(filename, "a"));
+ FILE *file = ufopen(filename, "a");
+ if (file == NULL) {
+ /* File couldn't be opened, e.g. due to permission error. */
+ return NULL;
+ }
+ fclose(file);
}
/* temporary #if until we update all libraries to 1.2.7