r23565: Avoid double NULL pointer checks.
authorGünther Deschner <gd@samba.org>
Thu, 21 Jun 2007 14:04:55 +0000 (14:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:30 +0000 (12:23 -0500)
Guenther

source/nsswitch/winbindd_cm.c
source/nsswitch/winbindd_dual.c

index c5e014192e87bae8a70f1944295de9be3033e2a9..0571cdad60b71a2e863b84145e897fff307805a2 100644 (file)
@@ -258,9 +258,7 @@ static void check_domain_online_handler(struct event_context *ctx,
                  "%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 @@ void set_domain_offline(struct winbindd_domain *domain)
        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 @@ static void set_domain_online(struct winbindd_domain *domain)
 
        /* 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(),
index cc15398d420ae5c5751fcb9307551e5ea3f19f7b..312e1b5ad446fded0eea22625ce16e22e9459960 100644 (file)
@@ -248,9 +248,7 @@ static void async_reply_recv(void *private_data, BOOL success)
                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 @@ static void account_lockout_policy_handler(struct event_context *ctx,
 
        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 @@ static BOOL fork_domain_child(struct winbindd_child *child)
 
        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);
                }
        }