diff libao2/ao_coreaudio.c @ 32537:8fa2f43cb760

Remove most of the NULL pointer check before free all over the code
author cboesch
date Sun, 14 Nov 2010 09:12:34 +0000
parents d9c8f66f77e1
children 5533ffce9c6b
line wrap: on
line diff
--- a/libao2/ao_coreaudio.c	Sat Nov 13 10:23:34 2010 +0000
+++ b/libao2/ao_coreaudio.c	Sun Nov 14 09:12:34 2010 +0000
@@ -728,7 +728,7 @@
                     ao_msg(MSGT_AO, MSGL_WARN,
                            "Could not retrieve the original stream format: [%4.4s]\n",
                            (char *)&err);
-                    if (p_format_list) free(p_format_list);
+                    free(p_format_list);
                     continue;
                 }
                 ao->b_revert = 1;
@@ -755,9 +755,9 @@
                 ao->stream_format = p_format_list[i_current_rate_format];
             else ao->stream_format = p_format_list[i_backup_rate_format]; /* And if we have to, any digital format will be just fine (highest rate possible). */
         }
-        if (p_format_list) free(p_format_list);
+        free(p_format_list);
     }
-    if (p_streams) free(p_streams);
+    free(p_streams);
 
     if (ao->i_stream_index < 0)
     {