don't alloc/free NULL

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5470 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi committed 2002-04-03 15:40:13 +00:00
1 parent 3909deefdb
commit 85f68b48b8
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -347,7 +347,7 @@ void ds_free_packs(demux_stream_t *ds){
demux_packet_t *dp=ds->first;
while(dp){
demux_packet_t *dn=dp->next;
free(dp->buffer);
if(dp->buffer) free(dp->buffer);
free(dp);
dp=dn;
}
+1 -1
View File
@@ -118,7 +118,7 @@ typedef struct demuxer_st {
inline static demux_packet_t* new_demux_packet(int len){
demux_packet_t* dp=malloc(sizeof(demux_packet_t));
dp->len=len;
dp->buffer=malloc(len);
dp->buffer=len?malloc(len):NULL;
dp->next=NULL;
dp->pts=0;
dp->pos=0;