tlv: free intermediate messages when they're created

otherwise they'll get cleaned up when the message is free'd.
it's nbd either way, but this seems tighter.
This commit is contained in:
lisa neigut
2019-03-25 17:48:01 -07:00
committed by Rusty Russell
parent 4afcc2e5a8
commit 5d8b059ccc

View File

@@ -839,6 +839,7 @@ tlv__type_impl_towire_fields = """\tif ({tlv_name}->{name}) {{
\t\tmsg_len = tal_count(tlv_msg);
\t\ttowire_u8(p, msg_len);
\t\ttowire_u8_array(p, tlv_msg, msg_len);
\t\ttal_free(tlv_msg);
\t}}
"""