mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
ECMAScript: Fix a leak in case of setTimeout(..., 0)
identified by Jonas seconds after I pushed the original fix out. *blush*
This commit is contained in:
parent
a0bc4f7792
commit
eab3cb762f
@ -411,8 +411,10 @@ window_setTimeout(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval
|
||||
if (!code)
|
||||
return JS_TRUE;
|
||||
timeout = atoi(jsval_to_string(ctx, &argv[1]));
|
||||
if (timeout <= 0)
|
||||
if (timeout <= 0) {
|
||||
mem_free(code);
|
||||
return JS_TRUE;
|
||||
}
|
||||
ecmascript_set_timeout(interpreter, code, timeout);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user