summaryrefslogtreecommitdiffstats
path: root/unrarlib.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-03-14 17:42:21 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-03-14 17:42:21 +0000
commit472a166803cda02f4f52c3e1c5af2a6bade9fbe4 (patch)
tree08394e3df89a7eea5796f19ba2a2717266489073 /unrarlib.c
parentd5d89cca6a1cca4290ac157fc706337831232d2d (diff)
downloadmpv-472a166803cda02f4f52c3e1c5af2a6bade9fbe4.tar.bz2
mpv-472a166803cda02f4f52c3e1c5af2a6bade9fbe4.tar.xz
Some free(NULL) found with njamd
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9585 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'unrarlib.c')
-rw-r--r--unrarlib.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/unrarlib.c b/unrarlib.c
index 9d4299adbc..f02aaf7eb8 100644
--- a/unrarlib.c
+++ b/unrarlib.c
@@ -293,11 +293,11 @@ struct NewMainArchiveHeader NewMhd;
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 @@ int urarlib_get(void *output,
}
#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 @@ int urarlib_get(void *output,
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;