nostrdb: mem: builder clear before free

This commit is contained in:
William Casarin
2025-07-11 12:26:18 -07:00
committed by Daniel D’Aquino
parent 4d8313c788
commit 8014d772ba

View File

@@ -2674,13 +2674,16 @@ void ndb_profile_record_builder_init(struct ndb_profile_record_builder *b)
void ndb_profile_record_builder_free(struct ndb_profile_record_builder *b)
{
if (b->builder)
if (b->builder) {
flatcc_builder_clear(b->builder);
free(b->builder);
}
if (b->flatbuf)
free(b->flatbuf);
b->builder = NULL;
b->flatbuf = NULL;
}
int ndb_process_profile_note(struct ndb_note *note,