Alex Henrie : jscript: Remove unnecessary call to malloc in strbuf_ensure_size.
Module: wine Branch: master Commit: 01deef22114adda87f05fb8197a29435d9a9987f URL: https://gitlab.winehq.org/wine/wine/-/commit/01deef22114adda87f05fb8197a2943... Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Sun Jun 4 23:25:24 2023 -0600 jscript: Remove unnecessary call to malloc in strbuf_ensure_size. --- dlls/jscript/string.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index f7d02f1582a..4033f0a2b56 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -627,10 +627,7 @@ static BOOL strbuf_ensure_size(strbuf_t *buf, unsigned len) new_size = buf->size ? buf->size<<1 : 16; if(new_size < len) new_size = len; - if(buf->buf) - new_buf = realloc(buf->buf, new_size*sizeof(WCHAR)); - else - new_buf = malloc(new_size*sizeof(WCHAR)); + new_buf = realloc(buf->buf, new_size * sizeof(WCHAR)); if(!new_buf) return FALSE;
participants (1)
-
Alexandre Julliard