From 387af198d629fb6005c5c87cdcf13202abd420d4 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Fri, 11 Jul 2025 12:39:29 -0700 Subject: [PATCH] nostrdb: win: fix heap corruption with flatbuf --- nostrdb/src/nostrdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nostrdb/src/nostrdb.c b/nostrdb/src/nostrdb.c index 1a130c7a..a38f5293 100644 --- a/nostrdb/src/nostrdb.c +++ b/nostrdb/src/nostrdb.c @@ -2674,12 +2674,12 @@ 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->flatbuf) + flatcc_builder_aligned_free(b->flatbuf); if (b->builder) { flatcc_builder_clear(b->builder); free(b->builder); } - if (b->flatbuf) - free(b->flatbuf); b->builder = NULL; b->flatbuf = NULL;