shithub: libdvdcss

Download patch

ref: 125f5e4f764847326b57762c512e8725c837a8b4
parent: 2dc7cfb1efb64920ab9eaf3d2b8023464fcd1e64
author: Diego Biurrun <diego@biurrun.de>
date: Wed Oct 22 09:00:01 EDT 2014

Drop unnecessary NULL check before free().

--- a/src/device.c
+++ b/src/device.c
@@ -450,12 +450,9 @@
     }
 
     /* Free readv temporary buffer */
-    if( dvdcss->p_readv_buffer )
-    {
-        free( dvdcss->p_readv_buffer );
-        dvdcss->p_readv_buffer   = NULL;
-        dvdcss->i_readv_buf_size = 0;
-    }
+    free( dvdcss->p_readv_buffer );
+    dvdcss->p_readv_buffer   = NULL;
+    dvdcss->i_readv_buf_size = 0;
 
     return 0;
 #else
@@ -926,7 +923,7 @@
     {
         dvdcss->i_readv_buf_size = i_blocks * DVDCSS_BLOCK_SIZE;
 
-        if( dvdcss->p_readv_buffer ) free( dvdcss->p_readv_buffer );
+        free( dvdcss->p_readv_buffer );
 
         /* Allocate a buffer which will be used as a temporary storage
          * for readv */