diff options
Diffstat (limited to 'source4/lib/charcnv.c')
-rw-r--r-- | source4/lib/charcnv.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source4/lib/charcnv.c b/source4/lib/charcnv.c index 2ee2bd9bae..33c49504d8 100644 --- a/source4/lib/charcnv.c +++ b/source4/lib/charcnv.c @@ -208,11 +208,7 @@ ssize_t convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to, outbuf = NULL; convert: destlen = destlen * 2; - if (outbuf == NULL) { - ob = talloc_array_p(ctx, char, destlen); - } else { - ob = (char *)talloc_realloc(outbuf, destlen); - } + ob = (char *)talloc_realloc(ctx, outbuf, destlen); if (!ob) { DEBUG(0, ("convert_string_talloc: realloc failed!\n")); talloc_free(outbuf); @@ -245,7 +241,7 @@ convert: destlen = destlen - o_len; /* +2 for mandetory null termination, UTF8 or UTF16 */ - *dest = (char *)talloc_realloc(ob,destlen+2); + *dest = (char *)talloc_realloc(ctx, ob, destlen+2); if (!*dest) { DEBUG(0, ("convert_string_talloc: out of memory!\n")); talloc_free(ob); |