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:
authorCampbell Barton <ideasman42@gmail.com>2009-08-01 10:27:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-01 10:27:40 +0400
commite60138117caaafc0f9b422e5e3f1654127e4287a (patch)
treea651f97317e6b3deb50215599d92a79ccc0cb573 /source/blender/makesdna/intern/makesdna.c
parent0949d48d25efdb703e7b411b4403f3cdf0eb5308 (diff)
- Ancient resource leak (rev 2) where checkPackedFile would open a file and never close it.
- Running simulations missed freeing some variables.
Diffstat (limited to 'source/blender/makesdna/intern/makesdna.c')
-rw-r--r--source/blender/makesdna/intern/makesdna.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index b4deb1f2b60..7529f2140a5 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -483,15 +483,18 @@ static void *read_file_data(char *filename, int *len_r)
data= MEM_mallocN(*len_r, "read_file_data");
if (!data) {
*len_r= -1;
+ fclose(fp);
return NULL;
}
if (fread(data, *len_r, 1, fp)!=1) {
*len_r= -1;
MEM_freeN(data);
+ fclose(fp);
return NULL;
}
-
+
+ fclose(fp);
return data;
}