diff --git a/src/unicode_builtin.c b/src/unicode_builtin.c index e2ee0ab..6d398b7 100644 --- a/src/unicode_builtin.c +++ b/src/unicode_builtin.c @@ -372,13 +372,13 @@ static inline bool unicode_builtin_encoding_convert( goto done; } + out_len = out_start - out; + if ((new_out = realloc(out, out_size)) == NULL) { ntlm_client_set_errmsg(ntlm, "out of memory"); goto done; } - out_len = out_start - out; - out = new_out; out_start = new_out + out_len; out_end = out + out_size;