From bc629c6faf5a575a39a31ffe6ced13165563ca29 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sat, 12 Jan 2008 02:17:10 +0100 Subject: For libnet_join error string functions, make sure not to overwrite last status string. Guenther (This used to be commit a9b76c9e2d93c8aa482dbee54f29d7e1503abe4f) --- source3/libnet/libnet_join.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source3/libnet/libnet_join.c') diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index b2522e9b58..fbbbb51bbc 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -30,14 +30,14 @@ static void libnet_join_set_error_string(TALLOC_CTX *mem_ctx, const char *format, ...) { va_list args; - char *tmp = NULL; + + if (r->out.error_string) { + return; + } va_start(args, format); - tmp = talloc_vasprintf(mem_ctx, format, args); + r->out.error_string = talloc_vasprintf(mem_ctx, format, args); va_end(args); - - TALLOC_FREE(r->out.error_string); - r->out.error_string = tmp; } /**************************************************************** @@ -48,14 +48,14 @@ static void libnet_unjoin_set_error_string(TALLOC_CTX *mem_ctx, const char *format, ...) { va_list args; - char *tmp = NULL; + + if (r->out.error_string) { + return; + } va_start(args, format); - tmp = talloc_vasprintf(mem_ctx, format, args); + r->out.error_string = talloc_vasprintf(mem_ctx, format, args); va_end(args); - - TALLOC_FREE(r->out.error_string); - r->out.error_string = tmp; } #ifdef WITH_ADS -- cgit