[SCM] Samba Shared Repository - branch v3-3-test updated -
release-3-2-0pre2-4590-g37a92ed
Stefan Metzmacher
metze at samba.org
Wed Dec 3 10:14:56 GMT 2008
The branch, v3-3-test has been updated
via 37a92ed0eb2c8cf7f3eac1d90ba5300cbce45186 (commit)
from 56a7b902765b5b4bf76d95c4e6e66ad89920a7bf (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test
- Log -----------------------------------------------------------------
commit 37a92ed0eb2c8cf7f3eac1d90ba5300cbce45186
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Dec 3 09:07:00 2008 +0100
libwbclient: avoid usage talloc_init() in library code
talloc_init() is a compat function for the old samba3
non-hierachical talloc implementation. It enables
the talloc null tracking which should never be done
by library code.
metze
(cherry picked from commit afa0d6b0b14e0ef2293bd8468ffc1d6330abdb5b)
-----------------------------------------------------------------------
Summary of changes:
source/nsswitch/libwbclient/wbc_sid.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/nsswitch/libwbclient/wbc_sid.c b/source/nsswitch/libwbclient/wbc_sid.c
index 9c886df..18516b6 100644
--- a/source/nsswitch/libwbclient/wbc_sid.c
+++ b/source/nsswitch/libwbclient/wbc_sid.c
@@ -40,22 +40,18 @@ wbcErr wbcSidToString(const struct wbcDomainSid *sid,
uint32_t id_auth;
int i;
char *tmp = NULL;
- TALLOC_CTX *ctx = NULL;
if (!sid) {
wbc_status = WBC_ERR_INVALID_SID;
BAIL_ON_WBC_ERROR(wbc_status);
}
- ctx = talloc_init("wbcSidToString");
- BAIL_ON_PTR_ERROR(ctx, wbc_status);
-
id_auth = sid->id_auth[5] +
(sid->id_auth[4] << 8) +
(sid->id_auth[3] << 16) +
(sid->id_auth[2] << 24);
- tmp = talloc_asprintf(ctx, "S-%d-%d", sid->sid_rev_num, id_auth);
+ tmp = talloc_asprintf(NULL, "S-%d-%d", sid->sid_rev_num, id_auth);
BAIL_ON_PTR_ERROR(tmp, wbc_status);
for (i=0; i<sid->num_auths; i++) {
@@ -66,13 +62,13 @@ wbcErr wbcSidToString(const struct wbcDomainSid *sid,
tmp = tmp2;
}
- *sid_string=talloc_strdup(NULL, tmp);
- BAIL_ON_PTR_ERROR((*sid_string), wbc_status);
+ *sid_string = tmp;
+ tmp = NULL;
wbc_status = WBC_ERR_SUCCESS;
done:
- talloc_free(ctx);
+ talloc_free(tmp);
return wbc_status;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list