diff options
author | Robert Guetzkow <gitcommit@outlook.de> | 2020-11-16 15:23:59 +0300 |
---|---|---|
committer | Robert Guetzkow <gitcommit@outlook.de> | 2020-11-16 15:23:59 +0300 |
commit | 62c4d0419ca03816caa444e7d41f6865ea082c13 (patch) | |
tree | b113b883f1fef9a9cacccdd4c65ee5ef23698b27 /source/blender | |
parent | 8b88739848673ab16d585aafb1ac5fcae27c1826 (diff) | |
parent | 8b815c7ce565b707fca9e9793bbec9784856f0f9 (diff) |
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 7 |
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 |