diff stream/network.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 01115062cb22
children d12d304b4dbd
line wrap: on
line diff
--- a/stream/network.c	Sun Nov 07 11:03:47 2010 +0000
+++ b/stream/network.c	Sun Nov 07 12:47:40 2010 +0000
@@ -127,9 +127,9 @@
 streaming_ctrl_free( streaming_ctrl_t *streaming_ctrl ) {
 	if( streaming_ctrl==NULL ) return;
 	if( streaming_ctrl->url ) url_free( streaming_ctrl->url );
-	if( streaming_ctrl->buffer ) free( streaming_ctrl->buffer );
-	if( streaming_ctrl->data ) free( streaming_ctrl->data );
-	free( streaming_ctrl );
+	free(streaming_ctrl->buffer);
+	free(streaming_ctrl->data);
+	free(streaming_ctrl);
 }
 
 URL_t*
@@ -331,14 +331,10 @@
 		return -1;
 	}
 	if( *auth_retry>0 ) {
-		if( url->username ) {
-			free( url->username );
-			url->username = NULL;
-		}
-		if( url->password ) {
-			free( url->password );
-			url->password = NULL;
-		}
+		free(url->username);
+		url->username = NULL;
+		free(url->password);
+		url->password = NULL;
 	}
 
 	aut = http_get_field(http_hdr, "WWW-Authenticate");