mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:54:13 +00:00
jscript: Fix memory leak on error path in String_replace (scan-build).
This commit is contained in:
parent
ea58ec849f
commit
66929987ab
1 changed files with 3 additions and 1 deletions
|
@ -926,8 +926,10 @@ static HRESULT String_replace(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsi
|
|||
jsstr_t *ret_str;
|
||||
|
||||
ret_str = jsstr_alloc_len(ret.buf, ret.len);
|
||||
if(!ret_str)
|
||||
if(!ret_str) {
|
||||
free(ret.buf);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
TRACE("= %s\n", debugstr_jsstr(ret_str));
|
||||
*r = jsval_string(ret_str);
|
||||
|
|
Loading…
Reference in a new issue