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:
-rw-r--r--source/blender/makesdna/intern/makesdna.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index 4133afffeed..577b18556c8 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -421,7 +421,11 @@ int preprocess_include(char *maindata, int len)
int a, newlen, comment = 0;
char *cp, *temp, *md;
- temp= MEM_mallocN(len, "preprocess_include");
+ /* note: len + 1, last character is a dummy to prevent
+ * comparisons using uninitialized memory */
+ temp= MEM_mallocN(len + 1, "preprocess_include");
+ temp[len]= ' ';
+
memcpy(temp, maindata, len);
// remove all c++ comments
@@ -1054,6 +1058,7 @@ int make_structDNA(char *baseDirectory, FILE *file)
MEM_freeN(names);
MEM_freeN(types);
MEM_freeN(typelens);
+ MEM_freeN(alphalens);
MEM_freeN(structs);
if (debugSDNA > -1) printf("done.\n");