diff options
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 38b58d8794f..7ced7f74c7a 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -202,6 +202,9 @@ static WriteData *writedata_new(int file) /* XXX, see note about this in readfile.c, remove * once we have an xp lock - zr */ + + if (wd == NULL) return NULL; + wd->sdna= dna_sdna_from_data(DNAstr, DNAlen, 0); wd->file= file; @@ -213,6 +216,7 @@ static WriteData *writedata_new(int file) static void writedata_do_write(WriteData *wd, void *mem, int memlen) { + if ((wd == NULL) || wd->error || (mem == NULL) || memlen < 1) return; if (wd->error) return; /* memory based save */ @@ -288,6 +292,8 @@ static WriteData *bgnwrite(int file, MemFile *compare, MemFile *current, int wri { WriteData *wd= writedata_new(file); + if (wd == NULL) return NULL; + wd->compare= compare; wd->current= current; /* this inits comparing */ @@ -727,8 +733,10 @@ static void write_modifiers(WriteData *wd, ListBase *modbase) { ModifierData *md; + if (modbase == NULL) return; for (md=modbase->first; md; md= md->next) { ModifierTypeInfo *mti = modifierType_getInfo(md->type); + if (mti == NULL) return; writestruct(wd, DATA, mti->structName, 1, md); @@ -1828,6 +1836,12 @@ static char *get_runtime_path(char *exename) { return NULL; } else { char *path= MEM_mallocN(strlen(installpath)+strlen(PATHSEPERATOR)+strlen(exename)+1, "runtimepath"); + + if (path == NULL) { + MEM_freeN(installpath); + return NULL; + } + strcpy(path, installpath); strcat(path, PATHSEPERATOR); strcat(path, exename); |