summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2009-10-15 04:31:26 +0800
committerBo Yang <boyang@samba.org>2009-10-15 04:31:26 +0800
commit8e91c40574ce30a053ff8979e69205d15fb89a5c (patch)
tree3294b0f5412e86df144b87e099e15bd1468df962 /nsswitch
parente0e7ca4ee83dac62f5b1d61a711a852679e0c0a0 (diff)
downloadsamba-8e91c40574ce30a053ff8979e69205d15fb89a5c.tar.gz
samba-8e91c40574ce30a053ff8979e69205d15fb89a5c.tar.bz2
samba-8e91c40574ce30a053ff8979e69205d15fb89a5c.zip
s3: Fix reference to freed memory in pam_winbind.
Signed-off-by: Bo Yang <boyang@samba.org>
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/pam_winbind.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index 654b4385d8..fd06688d08 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -981,6 +981,7 @@ static bool winbind_name_to_sid_string(struct pwb_context *ctx,
int sid_list_buffer_size)
{
const char* sid_string;
+ char *sid_str;
/* lookup name? */
if (IS_SID_STRING(name)) {
@@ -989,7 +990,6 @@ static bool winbind_name_to_sid_string(struct pwb_context *ctx,
wbcErr wbc_status;
struct wbcDomainSid sid;
enum wbcSidType type;
- char *sid_str;
_pam_log_debug(ctx, LOG_DEBUG,
"no sid given, looking up: %s\n", name);
@@ -1006,15 +1006,16 @@ static bool winbind_name_to_sid_string(struct pwb_context *ctx,
return false;
}
- wbcFreeMemory(sid_str);
sid_string = sid_str;
}
if (!safe_append_string(sid_list_buffer, sid_string,
sid_list_buffer_size)) {
+ wbcFreeMemory(sid_str);
return false;
}
+ wbcFreeMemory(sid_str);
return true;
}