diff options
author | Volker Lendecke <vl@samba.org> | 2010-04-03 21:45:55 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-04-03 22:12:23 +0200 |
commit | bbe07972e65024dba7d9fa767ba8d8907829a986 (patch) | |
tree | 66bacba5980c80a3775bce0000af1df55191ea5f /nsswitch/libwbclient | |
parent | 710aa773d54509de34404f9992c5058ddfa45f3b (diff) | |
download | samba-bbe07972e65024dba7d9fa767ba8d8907829a986.tar.gz samba-bbe07972e65024dba7d9fa767ba8d8907829a986.tar.bz2 samba-bbe07972e65024dba7d9fa767ba8d8907829a986.zip |
libwbclient: Both talloc_free and wbcFreeMemory deal with NULL
This is in line with the ANSI C standard definition of free(NULL)
Diffstat (limited to 'nsswitch/libwbclient')
-rw-r--r-- | nsswitch/libwbclient/wbc_pwd.c | 5 | ||||
-rw-r--r-- | nsswitch/libwbclient/wbc_sid.c | 19 |
2 files changed, 6 insertions, 18 deletions
diff --git a/nsswitch/libwbclient/wbc_pwd.c b/nsswitch/libwbclient/wbc_pwd.c index bae6bf91ea..9b8df4d907 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 a0b8d0f6a9..e58912214e 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; } |