Fixed some memory leaks. Memory leak-related paranoia. Minor cleanups.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3659 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2021-09-06 20:54:44 +00:00
parent 35e0d8b68a
commit e85168ac53
7 changed files with 16 additions and 30 deletions

View File

@ -473,13 +473,6 @@ bool tf_ssb_verify_and_strip_signature(JSContext* context, JSValue val, char* ou
return verified;
}
void tf_ssb_send_createHistoryStream(tf_ssb_t* ssb, const char* id)
{
for (tf_ssb_connection_t* connection = ssb->connections; connection; connection = connection->next) {
tf_ssb_rpc_send_createHistoryStream(connection, id);
}
}
void tf_ssb_send_close(tf_ssb_t* ssb)
{
for (tf_ssb_connection_t* connection = ssb->connections; connection; connection = connection->next) {
@ -971,10 +964,8 @@ void tf_ssb_append_message(tf_ssb_t* ssb, JSValue message)
JSContext* context = ssb->context;
JSValue root = JS_NewObject(context);
JSValue previousstr = JS_NULL;
if (have_previous) {
previousstr = JS_NewString(context, previous_id);
JS_SetPropertyStr(context, root, "previous", previousstr);
JS_SetPropertyStr(context, root, "previous", JS_NewString(context, previous_id));
} else {
JS_SetPropertyStr(context, root, "previous", JS_NULL);
}