nsswitch: wbcFreeMemory deals fine with NULL
authorVolker Lendecke <vl@samba.org>
Thu, 3 Mar 2011 21:29:39 +0000 (22:29 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 5 Mar 2011 13:29:32 +0000 (14:29 +0100)
nsswitch/pam_winbind.c
nsswitch/wbinfo.c
source3/libsmb/ntlmssp.c

index e651ce0e498796a4c78c2b640c316f8fcad53634..e640b711bd098e643cbcb4254e071a7319f0a32d 100644 (file)
@@ -1899,9 +1899,7 @@ static int winbind_auth_request(struct pwb_context *ctx,
        }
 
  done:
-       if (logon.blobs) {
-               wbcFreeMemory(logon.blobs);
-       }
+       wbcFreeMemory(logon.blobs);
        if (info && info->blobs && !p_info) {
                wbcFreeMemory(info->blobs);
        }
index caa37f3c9ed0725c1f08c9e32d807205bd032a75..150193d33c5620491551dd1763a73731b61d39e7 100644 (file)
@@ -463,12 +463,8 @@ static bool wbinfo_get_sidaliases(const char *domain,
        wbcFreeMemory(alias_rids);
 
 done:
-       if (domain_sid_str) {
-               wbcFreeMemory(domain_sid_str);
-       }
-       if (dinfo) {
-               wbcFreeMemory(dinfo);
-       }
+       wbcFreeMemory(domain_sid_str);
+       wbcFreeMemory(dinfo);
        return (WBC_ERR_SUCCESS == wbc_status);
 }
 
@@ -1296,18 +1292,10 @@ static bool wbinfo_lookuprids(const char *domain, const char *arg)
 
        ret = true;
 done:
-       if (dinfo) {
-               wbcFreeMemory(dinfo);
-       }
-       if (domain_name) {
-               wbcFreeMemory(domain_name);
-       }
-       if (names) {
-               wbcFreeMemory(names);
-       }
-       if (types) {
-               wbcFreeMemory(types);
-       }
+       wbcFreeMemory(dinfo);
+       wbcFreeMemory(domain_name);
+       wbcFreeMemory(names);
+       wbcFreeMemory(types);
        TALLOC_FREE(mem_ctx);
        return ret;
 }
index 477b94c1d0974e9c25068cc5088a27c77442524c..7a006a373f9f5384722067dbabb26871bcaa2432 100644 (file)
@@ -463,9 +463,7 @@ static NTSTATUS ntlmssp_client_challenge(struct ntlmssp_state *ntlmssp_state,
                params.blobs = &auth_blob;
 
                wbc_status = wbcCredentialCache(&params, &info, &error);
-               if (error != NULL) {
-                       wbcFreeMemory(error);
-               }
+               wbcFreeMemory(error);
                if (!WBC_ERROR_IS_OK(wbc_status)) {
                        goto noccache;
                }