summaryrefslogtreecommitdiff
path: root/source3/libnet/libnet_join.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-01-12 02:17:10 +0100
committerGünther Deschner <gd@samba.org>2008-01-12 02:25:25 +0100
commitbc629c6faf5a575a39a31ffe6ced13165563ca29 (patch)
tree67ae793acc6ade06a8530c360c002eded46412e3 /source3/libnet/libnet_join.c
parente69c82eb44bce37e882677b47bdb092b99670bd6 (diff)
downloadsamba-bc629c6faf5a575a39a31ffe6ced13165563ca29.tar.gz
samba-bc629c6faf5a575a39a31ffe6ced13165563ca29.tar.bz2
samba-bc629c6faf5a575a39a31ffe6ced13165563ca29.zip
For libnet_join error string functions, make sure not to overwrite last status string.
Guenther (This used to be commit a9b76c9e2d93c8aa482dbee54f29d7e1503abe4f)
Diffstat (limited to 'source3/libnet/libnet_join.c')
-rw-r--r--source3/libnet/libnet_join.c20
1 files changed, 10 insertions, 10 deletions
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