svn commit: samba r23565 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_25/source/nsswitch SAMBA_3_0_26/source/nsswitch

gd at samba.org gd at samba.org
Thu Jun 21 14:04:58 GMT 2007


Author: gd
Date: 2007-06-21 14:04:55 +0000 (Thu, 21 Jun 2007)
New Revision: 23565

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23565

Log:
Avoid double NULL pointer checks.

Guenther

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
   branches/SAMBA_3_0_25/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0_25/source/nsswitch/winbindd_dual.c
   branches/SAMBA_3_0_26/source/nsswitch/winbindd_cm.c
   branches/SAMBA_3_0_26/source/nsswitch/winbindd_dual.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c	2007-06-21 13:05:56 UTC (rev 23564)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cm.c	2007-06-21 14:04:55 UTC (rev 23565)
@@ -258,9 +258,7 @@
 		  "%s (online = %s)\n", domain->name, 
 		  domain->online ? "True" : "False" ));
 
-	if (domain->check_online_event) {
-		TALLOC_FREE(domain->check_online_event);
-	}
+	TALLOC_FREE(domain->check_online_event);
 
 	/* Are we still in "startup" mode ? */
 
@@ -312,9 +310,7 @@
 	DEBUG(10,("set_domain_offline: called for domain %s\n",
 		domain->name ));
 
-	if (domain->check_online_event) {
-		TALLOC_FREE(domain->check_online_event);
-	}
+	TALLOC_FREE(domain->check_online_event);
 
 	if (domain->internal) {
 		DEBUG(3,("set_domain_offline: domain %s is internal - logic error.\n",
@@ -426,9 +422,7 @@
 
 	/* Ensure we have no online timeout checks. */
 	domain->check_online_timeout = 0;
-	if (domain->check_online_event) {
-		TALLOC_FREE(domain->check_online_event);
-	}
+	TALLOC_FREE(domain->check_online_event);
 
 	/* Ensure we ignore any pending child messages. */
 	messaging_deregister(winbind_messaging_context(),

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c	2007-06-21 13:05:56 UTC (rev 23564)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c	2007-06-21 14:04:55 UTC (rev 23565)
@@ -248,9 +248,7 @@
 		talloc_get_type_abort(private_data, struct winbindd_async_request);
 	struct winbindd_child *child = state->child;
 
-	if (state->reply_timeout_event) {
-		TALLOC_FREE(state->reply_timeout_event);
-	}
+	TALLOC_FREE(state->reply_timeout_event);
 
 	state->response->length = sizeof(struct winbindd_response);
 
@@ -736,9 +734,7 @@
 
 	DEBUG(10,("account_lockout_policy_handler called\n"));
 
-	if (child->lockout_policy_event) {
-		TALLOC_FREE(child->lockout_policy_event);
-	}
+	TALLOC_FREE(child->lockout_policy_event);
 
 	if ( !winbindd_can_contact_domain( child->domain ) ) {
 		DEBUG(10,("account_lockout_policy_handler: Removing myself since I "
@@ -1016,9 +1012,7 @@
 
 	for (domain = domain_list(); domain; domain = domain->next) {
 		if (domain != child->domain) {
-			if (domain->check_online_event) {
-				TALLOC_FREE(domain->check_online_event);
-			}
+			TALLOC_FREE(domain->check_online_event);
 		}
 	}
 

Modified: branches/SAMBA_3_0_25/source/nsswitch/winbindd_cm.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/winbindd_cm.c	2007-06-21 13:05:56 UTC (rev 23564)
+++ branches/SAMBA_3_0_25/source/nsswitch/winbindd_cm.c	2007-06-21 14:04:55 UTC (rev 23565)
@@ -249,9 +249,7 @@
 	DEBUG(10,("check_domain_online_handler: called for domain %s\n",
 		domain->name ));
 
-	if (domain->check_online_event) {
-		TALLOC_FREE(domain->check_online_event);
-	}
+	TALLOC_FREE(domain->check_online_event);
 
 	/* Are we still in "startup" mode ? */
 
@@ -303,9 +301,7 @@
 	DEBUG(10,("set_domain_offline: called for domain %s\n",
 		domain->name ));
 
-	if (domain->check_online_event) {
-		TALLOC_FREE(domain->check_online_event);
-	}
+	TALLOC_FREE(domain->check_online_event);
 
 	if (domain->internal) {
 		DEBUG(3,("set_domain_offline: domain %s is internal - logic error.\n",
@@ -400,9 +396,7 @@
 
 	/* Ensure we have no online timeout checks. */
 	domain->check_online_timeout = 0;
-	if (domain->check_online_event) {
-		TALLOC_FREE(domain->check_online_event);
-	}
+	TALLOC_FREE(domain->check_online_event);
 
 	/* Ensure we ignore any pending child messages. */
 	message_deregister(MSG_WINBIND_TRY_TO_GO_ONLINE);

Modified: branches/SAMBA_3_0_25/source/nsswitch/winbindd_dual.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/winbindd_dual.c	2007-06-21 13:05:56 UTC (rev 23564)
+++ branches/SAMBA_3_0_25/source/nsswitch/winbindd_dual.c	2007-06-21 14:04:55 UTC (rev 23565)
@@ -248,9 +248,7 @@
 		talloc_get_type_abort(private_data, struct winbindd_async_request);
 	struct winbindd_child *child = state->child;
 
-	if (state->reply_timeout_event) {
-		TALLOC_FREE(state->reply_timeout_event);
-	}
+	TALLOC_FREE(state->reply_timeout_event);
 
 	state->response->length = sizeof(struct winbindd_response);
 
@@ -713,9 +711,7 @@
 
 	DEBUG(10,("account_lockout_policy_handler called\n"));
 
-	if (child->lockout_policy_event) {
-		TALLOC_FREE(child->lockout_policy_event);
-	}
+	TALLOC_FREE(child->lockout_policy_event);
 
 	methods = child->domain->methods;
 
@@ -962,9 +958,7 @@
 
 	for (domain = domain_list(); domain; domain = domain->next) {
 		if (domain != child->domain) {
-			if (domain->check_online_event) {
-				TALLOC_FREE(domain->check_online_event);
-			}
+			TALLOC_FREE(domain->check_online_event);
 		}
 	}
 

Modified: branches/SAMBA_3_0_26/source/nsswitch/winbindd_cm.c
===================================================================
--- branches/SAMBA_3_0_26/source/nsswitch/winbindd_cm.c	2007-06-21 13:05:56 UTC (rev 23564)
+++ branches/SAMBA_3_0_26/source/nsswitch/winbindd_cm.c	2007-06-21 14:04:55 UTC (rev 23565)
@@ -258,9 +258,7 @@
 		  "%s (online = %s)\n", domain->name, 
 		  domain->online ? "True" : "False" ));
 
-	if (domain->check_online_event) {
-		TALLOC_FREE(domain->check_online_event);
-	}
+	TALLOC_FREE(domain->check_online_event);
 
 	/* Are we still in "startup" mode ? */
 
@@ -312,9 +310,7 @@
 	DEBUG(10,("set_domain_offline: called for domain %s\n",
 		domain->name ));
 
-	if (domain->check_online_event) {
-		TALLOC_FREE(domain->check_online_event);
-	}
+	TALLOC_FREE(domain->check_online_event);
 
 	if (domain->internal) {
 		DEBUG(3,("set_domain_offline: domain %s is internal - logic error.\n",
@@ -426,9 +422,7 @@
 
 	/* Ensure we have no online timeout checks. */
 	domain->check_online_timeout = 0;
-	if (domain->check_online_event) {
-		TALLOC_FREE(domain->check_online_event);
-	}
+	TALLOC_FREE(domain->check_online_event);
 
 	/* Ensure we ignore any pending child messages. */
 	messaging_deregister(winbind_messaging_context(),

Modified: branches/SAMBA_3_0_26/source/nsswitch/winbindd_dual.c
===================================================================
--- branches/SAMBA_3_0_26/source/nsswitch/winbindd_dual.c	2007-06-21 13:05:56 UTC (rev 23564)
+++ branches/SAMBA_3_0_26/source/nsswitch/winbindd_dual.c	2007-06-21 14:04:55 UTC (rev 23565)
@@ -248,9 +248,7 @@
 		talloc_get_type_abort(private_data, struct winbindd_async_request);
 	struct winbindd_child *child = state->child;
 
-	if (state->reply_timeout_event) {
-		TALLOC_FREE(state->reply_timeout_event);
-	}
+	TALLOC_FREE(state->reply_timeout_event);
 
 	state->response->length = sizeof(struct winbindd_response);
 
@@ -736,9 +734,7 @@
 
 	DEBUG(10,("account_lockout_policy_handler called\n"));
 
-	if (child->lockout_policy_event) {
-		TALLOC_FREE(child->lockout_policy_event);
-	}
+	TALLOC_FREE(child->lockout_policy_event);
 
 	if ( !winbindd_can_contact_domain( child->domain ) ) {
 		DEBUG(10,("account_lockout_policy_handler: Removing myself since I "
@@ -1016,9 +1012,7 @@
 
 	for (domain = domain_list(); domain; domain = domain->next) {
 		if (domain != child->domain) {
-			if (domain->check_online_event) {
-				TALLOC_FREE(domain->check_online_event);
-			}
+			TALLOC_FREE(domain->check_online_event);
 		}
 	}
 



More information about the samba-cvs mailing list