diff options
author | Dmitry Volyntsev <xeioexception@gmail.com> | 2024-07-14 15:08:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-15 00:08:40 +0200 |
commit | b3715f7cb1f7e7e99fa5e768e3af3f6bb22ae50f (patch) | |
tree | dcbb681f7e0c4b9a72ed4e739c9bc443464421d4 /quickjs.c | |
parent | 36911f0d3ab1a4c190a4d5cbe7c2db225a455389 (diff) | |
download | quickjs-b3715f7cb1f7e7e99fa5e768e3af3f6bb22ae50f.tar.gz quickjs-b3715f7cb1f7e7e99fa5e768e3af3f6bb22ae50f.zip |
Fix GC leak in `js_proxy_get()` (#302)
Fixes #277
Diffstat (limited to 'quickjs.c')
-rw-r--r-- | quickjs.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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)) { |