summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorVolker Lendecke <vl@sernet.de>2007-11-24 17:27:19 +0100
committerVolker Lendecke <vl@sernet.de>2007-11-26 17:48:40 +0100
commitd5b2325fcd597813b081d17161d26d85110c100b (patch)
tree3c45cd2e429a601a9038533de06eedf3fa3fbf8b /source3/libads
parentd4bfafa29c62c69b002b1ca9f527c51c00fd3fd6 (diff)
downloadsamba-d5b2325fcd597813b081d17161d26d85110c100b.tar.gz
samba-d5b2325fcd597813b081d17161d26d85110c100b.tar.bz2
samba-d5b2325fcd597813b081d17161d26d85110c100b.zip
Remove a global
(This used to be commit 3088bc76f1ceffecaa5aea039be79973c9876f0c)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ads_status.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source3/libads/ads_status.c b/source3/libads/ads_status.c
index 3f0ab57638..ecef9d224b 100644
--- a/source3/libads/ads_status.c
+++ b/source3/libads/ads_status.c
@@ -99,10 +99,6 @@ NTSTATUS ads_ntstatus(ADS_STATUS status)
*/
const char *ads_errstr(ADS_STATUS status)
{
- static char *ret;
-
- SAFE_FREE(ret);
-
switch (status.error_type) {
case ENUM_ADS_ERROR_SYSTEM:
return strerror(status.err.rc);
@@ -117,6 +113,7 @@ const char *ads_errstr(ADS_STATUS status)
#ifdef HAVE_GSSAPI
case ENUM_ADS_ERROR_GSS:
{
+ char *ret;
uint32 msg_ctx;
uint32 minor;
gss_buffer_desc msg1, msg2;
@@ -129,7 +126,9 @@ const char *ads_errstr(ADS_STATUS status)
GSS_C_NULL_OID, &msg_ctx, &msg1);
gss_display_status(&minor, status.minor_status, GSS_C_MECH_CODE,
GSS_C_NULL_OID, &msg_ctx, &msg2);
- asprintf(&ret, "%s : %s", (char *)msg1.value, (char *)msg2.value);
+ ret = talloc_asprintf(talloc_tos(), "%s : %s",
+ (char *)msg1.value, (char *)msg2.value);
+ SMB_ASSERT(ret != NULL);
gss_release_buffer(&minor, &msg1);
gss_release_buffer(&minor, &msg2);
return ret;