[libdvdcss-devel] [PATCH 06/47] Drop unnecessary NULL check before free().
Diego Biurrun
diego at biurrun.de
Wed Oct 29 21:33:06 CET 2014
---
src/device.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/device.c b/src/device.c
index 7a96e9f..c7531bf 100644
--- a/src/device.c
+++ b/src/device.c
@@ -450,12 +450,9 @@ int _dvdcss_close ( dvdcss_t dvdcss )
}
/* 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 @@ static int win_readv ( dvdcss_t dvdcss, struct iovec *p_iovec, int i_blocks )
{
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 */
--
1.9.1
More information about the libdvdcss-devel
mailing list