nostrdb: mem: builder clear before free
This commit is contained in:
committed by
Daniel D’Aquino
parent
4d8313c788
commit
8014d772ba
@@ -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)
|
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);
|
free(b->builder);
|
||||||
|
}
|
||||||
if (b->flatbuf)
|
if (b->flatbuf)
|
||||||
free(b->flatbuf);
|
free(b->flatbuf);
|
||||||
|
|
||||||
b->builder = NULL;
|
b->builder = NULL;
|
||||||
b->flatbuf = NULL;
|
b->flatbuf = NULL;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ndb_process_profile_note(struct ndb_note *note,
|
int ndb_process_profile_note(struct ndb_note *note,
|
||||||
|
|||||||
Reference in New Issue
Block a user