Correct recent error passing NULL to fclose
authorCampbell Barton <ideasman42@gmail.com>
Mon, 28 Dec 2015 14:00:25 +0000 (01:00 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 28 Dec 2015 14:01:20 +0000 (01:01 +1100)
source/blender/blenlib/intern/storage.c

index 91df103bc7b202d6501bdac337913374f722f0d4..260a23c41dc659068f5229203ada6990d6268c27 100644 (file)
@@ -320,10 +320,11 @@ void *BLI_file_read_text_as_mem(const char *filepath, size_t pad_bytes, size_t *
                }
 
                *r_size = filelen_read;
-       }
 
 finally:
-       fclose(fp);
+               fclose(fp);
+       }
+
        return mem;
 }
 
@@ -353,10 +354,11 @@ void *BLI_file_read_binary_as_mem(const char *filepath, size_t pad_bytes, size_t
                }
 
                *r_size = filelen_read;
-       }
 
 finally:
-       fclose(fp);
+               fclose(fp);
+       }
+
        return mem;
 }