[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Sat Apr 3 14:13:40 MDT 2010


The branch, master has been updated
       via  bbe0797... libwbclient: Both talloc_free and wbcFreeMemory deal with NULL
      from  710aa77... socket-wrapper: not all systems have FIONREAD defined

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit bbe07972e65024dba7d9fa767ba8d8907829a986
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 3 21:45:55 2010 +0200

    libwbclient: Both talloc_free and wbcFreeMemory deal with NULL
    
    This is in line with the ANSI C standard definition of free(NULL)

-----------------------------------------------------------------------

Summary of changes:
 nsswitch/libwbclient/wbc_pwd.c |    5 +----
 nsswitch/libwbclient/wbc_sid.c |   19 +++++--------------
 2 files changed, 6 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/nsswitch/libwbclient/wbc_pwd.c b/nsswitch/libwbclient/wbc_pwd.c
index bae6bf9..9b8df4d 100644
--- a/nsswitch/libwbclient/wbc_pwd.c
+++ b/nsswitch/libwbclient/wbc_pwd.c
@@ -224,10 +224,7 @@ wbcErr wbcGetpwsid(struct wbcDomainSid *sid, struct passwd **pwd)
 	BAIL_ON_PTR_ERROR(*pwd, wbc_status);
 
  done:
-	if (sid_string) {
-		wbcFreeMemory(sid_string);
-	}
-
+	wbcFreeMemory(sid_string);
 	return wbc_status;
 }
 
diff --git a/nsswitch/libwbclient/wbc_sid.c b/nsswitch/libwbclient/wbc_sid.c
index a0b8d0f..e589122 100644
--- a/nsswitch/libwbclient/wbc_sid.c
+++ b/nsswitch/libwbclient/wbc_sid.c
@@ -553,10 +553,8 @@ wbcErr wbcGetSidAliases(const struct wbcDomainSid *dom_sid,
 
 	/* Build the sid list */
 	for (i=0; i<num_sids; i++) {
-		if (sid_string) {
-			wbcFreeMemory(sid_string);
-			sid_string = NULL;
-		}
+		wbcFreeMemory(sid_string);
+		sid_string = NULL;
 		wbc_status = wbcSidToString(&sids[i], &sid_string);
 		BAIL_ON_WBC_ERROR(wbc_status);
 
@@ -616,17 +614,10 @@ wbcErr wbcGetSidAliases(const struct wbcDomainSid *dom_sid,
 	wbc_status = WBC_ERR_SUCCESS;
 
  done:
-	if (sid_string) {
-		wbcFreeMemory(sid_string);
-	}
-	if (extra_data) {
-		talloc_free(extra_data);
-	}
+	wbcFreeMemory(sid_string);
+	talloc_free(extra_data);
 	winbindd_free_response(&response);
-	if (rids) {
-		talloc_free(rids);
-	}
-
+	talloc_free(rids);
 	return wbc_status;
 }
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list