diff sub/spudec.c @ 32511:b39155e98ac3

Remove some useless NULL pointer checks before invoking free() on the pointer. patch by From: Clment Bsch, ubitux gmail com
author diego
date Sun, 07 Nov 2010 12:47:40 +0000
parents fbe5c829c69b
children 1cad23803d94
line wrap: on
line diff
--- a/sub/spudec.c	Sun Nov 07 11:03:47 2010 +0000
+++ b/sub/spudec.c	Sun Nov 07 12:47:40 2010 +0000
@@ -146,8 +146,7 @@
 
 static void spudec_free_packet(packet_t *packet)
 {
-  if (packet->packet != NULL)
-    free(packet->packet);
+  free(packet->packet);
   free(packet);
 }
 
@@ -609,8 +608,7 @@
     unsigned int len2 = get_be16(packet);
     // Start new fragment
     if (spu->packet_reserve < len2) {
-      if (spu->packet != NULL)
-	free(spu->packet);
+      free(spu->packet);
       spu->packet = malloc(len2);
       spu->packet_reserve = spu->packet != NULL ? len2 : 0;
     }