diff options
-rw-r--r-- | source4/lib/util_str.c | 18 | ||||
-rw-r--r-- | source4/torture/rpc/samr.c | 15 |
2 files changed, 18 insertions, 15 deletions
diff --git a/source4/lib/util_str.c b/source4/lib/util_str.c index 66acc0ca0e..fd13f86501 100644 --- a/source4/lib/util_str.c +++ b/source4/lib/util_str.c @@ -1446,3 +1446,21 @@ const char *str_format_nbt_domain(TALLOC_CTX *mem_ctx, const char *s) return ret; } + +BOOL add_string_to_array(TALLOC_CTX *mem_ctx, + const char *str, const char ***strings, int *num) +{ + char *dup_str = talloc_strdup(mem_ctx, str); + + *strings = talloc_realloc(mem_ctx, *strings, + ((*num)+1) * sizeof(**strings)); + + if ((*strings == NULL) || (dup_str == NULL)) + return False; + + (*strings)[*num] = dup_str; + *num += 1; + + return True; +} + diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index c73672689e..1a48aaa944 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -2315,21 +2315,6 @@ static BOOL test_QueryDomainInfo2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } -void add_string_to_array(TALLOC_CTX *mem_ctx, - const char *str, const char ***strings, int *num) -{ - *strings = talloc_realloc(mem_ctx, *strings, - ((*num)+1) * sizeof(**strings)); - - if (*strings == NULL) - return; - - (*strings)[*num] = str; - *num += 1; - - return; -} - /* Test whether querydispinfo level 5 and enumdomgroups return the same set of group names. */ static BOOL test_GroupList(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, |