- ret = talloc_append_string(ret, strings[i]);
- ret = talloc_append_string(ret, delim);
+ size_t len = strlen(strings[i]);
+ ret = talloc_realloc(ctx, ret, char, totlen + len + dlen + 1);
+ memcpy(ret + totlen, strings[i], len);
+ totlen += len;
+ memcpy(ret + totlen, delim, dlen);
+ totlen += dlen;