diff --git a/src/ssb.js.c b/src/ssb.js.c index 661b6f3a..5efcc7a5 100644 --- a/src/ssb.js.c +++ b/src/ssb.js.c @@ -346,7 +346,9 @@ static JSValue _tf_ssb_appendMessageWithIdentity(JSContext* context, JSValueCons uint8_t private_key[crypto_sign_SECRETKEYBYTES]; if (tf_ssb_db_identity_get_private_key(ssb, user, id, private_key, sizeof(private_key))) { - tf_ssb_verify_strip_and_store_message(ssb, tf_ssb_sign_message(ssb, id, private_key, argv[2]), _tf_ssb_appendMessageWithIdentity_callback, async); + JSValue signed_message = tf_ssb_sign_message(ssb, id, private_key, argv[2]); + tf_ssb_verify_strip_and_store_message(ssb, signed_message, _tf_ssb_appendMessageWithIdentity_callback, async); + JS_FreeValue(context, signed_message); } else { diff --git a/src/ssb.rpc.c b/src/ssb.rpc.c index 89e41690..ac305f2f 100644 --- a/src/ssb.rpc.c +++ b/src/ssb.rpc.c @@ -905,6 +905,7 @@ static void _tf_ssb_rpc_createHistoryStream(tf_ssb_connection_t* connection, uin JS_FreeValue(context, id); JS_FreeValue(context, seq); JS_FreeValue(context, keys); + JS_FreeValue(context, live); JS_FreeValue(context, arg); JS_FreeValue(context, arg_array); }