Skip to content

Commit

Permalink
Fix GC leak in js_proxy_get() (#302)
Browse files Browse the repository at this point in the history
Fixes #277
  • Loading branch information
xeioex authored Jul 14, 2024
1 parent 36911f0 commit b3715f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -46151,8 +46151,10 @@ static JSValue js_proxy_get(JSContext *ctx, JSValueConst obj, JSAtom atom,
if (JS_IsException(ret))
return JS_EXCEPTION;
res = JS_GetOwnPropertyInternal(ctx, &desc, JS_VALUE_GET_OBJ(s->target), atom);
if (res < 0)
if (res < 0) {
JS_FreeValue(ctx, ret);
return JS_EXCEPTION;
}
if (res) {
if ((desc.flags & (JS_PROP_GETSET | JS_PROP_CONFIGURABLE | JS_PROP_WRITABLE)) == 0) {
if (!js_same_value(ctx, desc.value, ret)) {
Expand Down

0 comments on commit b3715f7

Please sign in to comment.