From 29fc728509b4e2055feeb1cfa53944f56365c78d Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Mon, 8 Jan 2024 02:30:08 +0000 Subject: [PATCH] These look like potential leaks. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4744 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- src/ssb.js.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ssb.js.c b/src/ssb.js.c index 74651fb0..1df7ff84 100644 --- a/src/ssb.js.c +++ b/src/ssb.js.c @@ -417,11 +417,15 @@ void _tf_ssb_blob_store_complete(blob_store_t* store, const char* id) if (id) { JSValue id_value = JS_NewString(store->context, id); - JS_Call(store->context, store->promise[0], JS_UNDEFINED, 1, &id_value); + JSValue result = JS_Call(store->context, store->promise[0], JS_UNDEFINED, 1, &id_value); + tf_util_report_error(store->context, result); + JS_FreeValue(store->context, result); } else { - JS_Call(store->context, store->promise[1], JS_UNDEFINED, 0, NULL); + JSValue result = JS_Call(store->context, store->promise[1], JS_UNDEFINED, 0, NULL); + tf_util_report_error(store->context, result); + JS_FreeValue(store->context, result); } tf_util_report_error(store->context, result); JS_FreeValue(store->context, result); @@ -1662,7 +1666,9 @@ static void _tf_ssb_following_after_work(uv_work_t* work, int status) JS_SetPropertyStr(context, entry, "ib", JS_NewInt32(context, following->out_following[i].blocked_by_count)); JS_SetPropertyStr(context, object, following->out_following[i].id, entry); } - JS_Call(context, following->promise[0], JS_UNDEFINED, 1, &object); + JSValue result = JS_Call(context, following->promise[0], JS_UNDEFINED, 1, &object); + tf_util_report_error(context, result); + JS_FreeValue(context, result); JS_FreeValue(context, object); } else @@ -1670,7 +1676,9 @@ static void _tf_ssb_following_after_work(uv_work_t* work, int status) char buffer[256]; uv_strerror_r(status, buffer, sizeof(buffer)); JSValue message = JS_NewString(context, buffer); - JS_Call(context, following->promise[1], JS_UNDEFINED, 1, &message); + JSValue result = JS_Call(context, following->promise[1], JS_UNDEFINED, 1, &message); + tf_util_report_error(context, result); + JS_FreeValue(context, result); JS_FreeValue(context, message); }