[Mplayer-cvslog] CVS: main unrarlib.c,1.2,1.3

Alban Bedel CVS albeu at mplayerhq.hu
Fri Mar 14 18:42:41 CET 2003


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv14794

Modified Files:
	unrarlib.c 
Log Message:
Some free(NULL) found with njamd


Index: unrarlib.c
===================================================================
RCS file: /cvsroot/mplayer/main/unrarlib.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- unrarlib.c	14 Dec 2002 17:54:59 -0000	1.2
+++ unrarlib.c	14 Mar 2003 17:42:21 -0000	1.3
@@ -293,11 +293,11 @@
 struct NewFileHeader NewLhd;
 struct BlockHeader BlockHead;
 
-UBYTE *TempMemory;                          /* temporary unpack-buffer      */
-char *CommMemory;
+UBYTE *TempMemory = NULL;                          /* temporary unpack-buffer      */
+char *CommMemory = NULL;
 
 
-UBYTE *UnpMemory;
+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;



More information about the MPlayer-cvslog mailing list