Skip to content

Commit b3715f7

Browse files
authored
Fix GC leak in js_proxy_get() (bellard#302)
Fixes bellard#277
1 parent 36911f0 commit b3715f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

quickjs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46151,8 +46151,10 @@ static JSValue js_proxy_get(JSContext *ctx, JSValueConst obj, JSAtom atom,
4615146151
if (JS_IsException(ret))
4615246152
return JS_EXCEPTION;
4615346153
res = JS_GetOwnPropertyInternal(ctx, &desc, JS_VALUE_GET_OBJ(s->target), atom);
46154-
if (res < 0)
46154+
if (res < 0) {
46155+
JS_FreeValue(ctx, ret);
4615546156
return JS_EXCEPTION;
46157+
}
4615646158
if (res) {
4615746159
if ((desc.flags & (JS_PROP_GETSET | JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)) == 0) {
4615846160
if (!js_same_value(ctx, desc.value, ret)) {

0 commit comments

Comments
 (0)