changeset 26085:681f6ae38b68

Remove stupid checks of free() argument.
author eugeni
date Fri, 29 Feb 2008 17:25:41 +0000
parents ec5749eb6f5f
children c9a877daca42
files libmpdemux/demux_mkv.c libmpdemux/demuxer.c
diffstat 2 files changed, 16 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Fri Feb 29 17:25:39 2008 +0000
+++ b/libmpdemux/demux_mkv.c	Fri Feb 29 17:25:41 2008 +0000
@@ -927,18 +927,12 @@
  */
 static void
 demux_mkv_free_trackentry(mkv_track_t *track) {
-  if (track->name)
-    free (track->name);
-  if (track->codec_id)
-    free (track->codec_id);
-  if (track->language)
-    free (track->language);
-  if (track->private_data)
-    free (track->private_data);
-  if (track->audio_buf)
-    free (track->audio_buf);
-  if (track->audio_timestamp)
-    free (track->audio_timestamp);
+  free (track->name);
+  free (track->codec_id);
+  free (track->language);
+  free (track->private_data);
+  free (track->audio_buf);
+  free (track->audio_timestamp);
   demux_mkv_free_encodings(track->encodings, track->num_encodings);
   free(track);
 }
@@ -2545,14 +2539,10 @@
             demux_mkv_free_trackentry(mkv_d->tracks[i]);
           free (mkv_d->tracks);
         }
-      if (mkv_d->indexes)
-        free (mkv_d->indexes);
-      if (mkv_d->cluster_positions)
-        free (mkv_d->cluster_positions);
-      if (mkv_d->parsed_cues)
-        free (mkv_d->parsed_cues);
-      if (mkv_d->parsed_seekhead)
-        free (mkv_d->parsed_seekhead);
+      free (mkv_d->indexes);
+      free (mkv_d->cluster_positions);
+      free (mkv_d->parsed_cues);
+      free (mkv_d->parsed_seekhead);
       free (mkv_d);
     }
 }
--- a/libmpdemux/demuxer.c	Fri Feb 29 17:25:39 2008 +0000
+++ b/libmpdemux/demuxer.c	Fri Feb 29 17:25:41 2008 +0000
@@ -251,7 +251,7 @@
 
 void free_sh_sub(sh_sub_t *sh) {
     mp_msg(MSGT_DEMUXER, MSGL_DBG2, "DEMUXER: freeing sh_sub at %p\n", sh);
-    if (sh->extradata) free(sh->extradata);
+    free(sh->extradata);
 #ifdef USE_ASS
     if (sh->ass_track) ass_free_track(sh->ass_track);
 #endif
@@ -288,8 +288,8 @@
     sh_audio_t *sh = demuxer->a_streams[id];
     demuxer->a_streams[id] = NULL;
     mp_msg(MSGT_DEMUXER,MSGL_DBG2,"DEMUXER: freeing sh_audio at %p\n",sh);
-    if(sh->wf) free(sh->wf);
-    if(sh->codecdata) free(sh->codecdata);
+    free(sh->wf);
+    free(sh->codecdata);
     free(sh->lang);
     free(sh);
 }
@@ -314,7 +314,7 @@
 
 void free_sh_video(sh_video_t* sh){
     mp_msg(MSGT_DEMUXER,MSGL_DBG2,"DEMUXER: freeing sh_video at %p\n",sh);
-    if(sh->bih) free(sh->bih);
+    free(sh->bih);
     free(sh);
 }
 
@@ -343,12 +343,10 @@
 	free(demuxer->info[i]);
       free(demuxer->info);
     }
-    if(demuxer->filename)
-      free(demuxer->filename);
+    free(demuxer->filename);
     if (demuxer->chapters) {
       for (i=0; i<demuxer->num_chapters; i++)
-        if (demuxer->chapters[i].name)
-          free(demuxer->chapters[i].name);
+        free(demuxer->chapters[i].name);
       free(demuxer->chapters);
     }
     if (demuxer->attachments) {