summaryrefslogtreecommitdiff
path: root/source3/libsmb/dcerpc_err.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libsmb/dcerpc_err.c')
-rw-r--r--source3/libsmb/dcerpc_err.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/libsmb/dcerpc_err.c b/source3/libsmb/dcerpc_err.c
index b1874b943f..900b8d769f 100644
--- a/source3/libsmb/dcerpc_err.c
+++ b/source3/libsmb/dcerpc_err.c
@@ -38,11 +38,9 @@ static const struct dcerpc_fault_table dcerpc_faults[] =
const char *dcerpc_errstr(uint32 fault_code)
{
- static pstring msg;
+ char *result;
int idx = 0;
- slprintf(msg, sizeof(msg), "DCERPC fault 0x%08x", fault_code);
-
while (dcerpc_faults[idx].errstr != NULL) {
if (dcerpc_faults[idx].faultcode == fault_code) {
return dcerpc_faults[idx].errstr;
@@ -50,5 +48,8 @@ const char *dcerpc_errstr(uint32 fault_code)
idx++;
}
- return msg;
+ result = talloc_asprintf(talloc_tos(), "DCERPC fault 0x%08x",
+ fault_code);
+ SMB_ASSERT(result != NULL);
+ return result;
}