# HG changeset patch # User albeu # Date 1047663741 0 # Node ID 31126ea5cd36a2a0f52d1b7f8b1d65c479bb871d # Parent e442209e6241c23669846585dbcd185430134dd1 Some free(NULL) found with njamd diff -r e442209e6241 -r 31126ea5cd36 unrarlib.c --- a/unrarlib.c Fri Mar 14 17:19:19 2003 +0000 +++ b/unrarlib.c Fri Mar 14 17:42:21 2003 +0000 @@ -293,11 +293,11 @@ struct NewFileHeader NewLhd; struct BlockHeader BlockHead; -UBYTE *TempMemory; /* temporary unpack-buffer */ -char *CommMemory; - - -UBYTE *UnpMemory; +UBYTE *TempMemory = NULL; /* temporary unpack-buffer */ +char *CommMemory = NULL; + + +UBYTE *UnpMemory = NULL; char ArgName[NM]; /* current file in rar archive */ char ArcFileName[NM]; /* file to decompress */ @@ -422,9 +422,9 @@ } #endif - free(UnpMemory); /* free memory */ - free(TempMemory); - free(CommMemory); + if(UnpMemory) free(UnpMemory); /* free memory */ + if(TempMemory) free(TempMemory); + if(CommMemory) free(CommMemory); UnpMemory=NULL; TempMemory=NULL; CommMemory=NULL; @@ -432,7 +432,8 @@ if(retcode == FALSE) { - free(temp_output_buffer); /* free memory and return NULL */ + if(temp_output_buffer) /* free memory and return NULL */ + free(temp_output_buffer); temp_output_buffer=NULL; *(DWORD*)output=0; /* pointer on errors */ *size=0;