diff options
author | Volker Lendecke <vl@sernet.de> | 2007-11-24 17:27:19 +0100 |
---|---|---|
committer | Volker Lendecke <vl@sernet.de> | 2007-11-26 17:48:40 +0100 |
commit | 3088bc76f1ceffecaa5aea039be79973c9876f0c (patch) | |
tree | e785edf6b924449b4ee9d7efd21bf71cbcaf6f01 /source/libads/ads_status.c | |
parent | 8bcd2df841bae63e7d58c35d4728b7d853471697 (diff) | |
download | samba-3088bc76f1ceffecaa5aea039be79973c9876f0c.tar.gz |
Remove a global
Diffstat (limited to 'source/libads/ads_status.c')
-rw-r--r-- | source/libads/ads_status.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/source/libads/ads_status.c b/source/libads/ads_status.c index 3f0ab576386..ecef9d224b3 100644 --- a/source/libads/ads_status.c +++ b/source/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; |