Fix some memory leaks I just introduced.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4173 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-02-08 01:50:47 +00:00
parent b35d74ce36
commit a5f9f927e6
2 changed files with 5 additions and 0 deletions

View File

@ -2331,6 +2331,7 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
{ {
sqlite3_close(ssb->db_readers[i]); sqlite3_close(ssb->db_readers[i]);
} }
tf_free(ssb->db_readers);
uv_mutex_destroy(&ssb->db_readers_lock); uv_mutex_destroy(&ssb->db_readers_lock);
tf_free((void*)ssb->db_path); tf_free((void*)ssb->db_path);
tf_free(ssb); tf_free(ssb);

View File

@ -516,6 +516,8 @@ static void _tf_ssb_sqlAsync_after_work(uv_work_t* work, int status)
tf_util_report_error(context, result); tf_util_report_error(context, result);
JS_FreeValue(context, sql_work->promise[0]); JS_FreeValue(context, sql_work->promise[0]);
JS_FreeValue(context, sql_work->promise[1]); JS_FreeValue(context, sql_work->promise[1]);
JS_FreeValue(context, sql_work->callback);
JS_FreeCString(context, sql_work->query);
tf_free(sql_work); 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); tf_util_report_error(context, result);
JS_FreeValue(context, work->promise[0]); JS_FreeValue(context, work->promise[0]);
JS_FreeValue(context, work->promise[1]); JS_FreeValue(context, work->promise[1]);
JS_FreeValue(context, work->callback);
JS_FreeValue(context, error); JS_FreeValue(context, error);
JS_FreeCString(context, query);
tf_free(work->binds); tf_free(work->binds);
tf_free(work); tf_free(work);
} }