diff --git a/src/ssb.c b/src/ssb.c index 13bc999a..48a0997f 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -2331,6 +2331,7 @@ void tf_ssb_destroy(tf_ssb_t* ssb) { sqlite3_close(ssb->db_readers[i]); } + tf_free(ssb->db_readers); uv_mutex_destroy(&ssb->db_readers_lock); tf_free((void*)ssb->db_path); tf_free(ssb); diff --git a/src/ssb.js.c b/src/ssb.js.c index 0569e678..9f47b204 100644 --- a/src/ssb.js.c +++ b/src/ssb.js.c @@ -516,6 +516,8 @@ static void _tf_ssb_sqlAsync_after_work(uv_work_t* work, int status) tf_util_report_error(context, result); JS_FreeValue(context, sql_work->promise[0]); JS_FreeValue(context, sql_work->promise[1]); + JS_FreeValue(context, sql_work->callback); + JS_FreeCString(context, sql_work->query); tf_free(sql_work); } @@ -585,7 +587,9 @@ static JSValue _tf_ssb_sqlAsync(JSContext* context, JSValueConst this_val, int a tf_util_report_error(context, result); JS_FreeValue(context, work->promise[0]); JS_FreeValue(context, work->promise[1]); + JS_FreeValue(context, work->callback); JS_FreeValue(context, error); + JS_FreeCString(context, query); tf_free(work->binds); tf_free(work); }