commit 62aa72c215e40df6b3d1db3fc439ae4934e914d5
parent 287b35a8fbe1115c99aaa9f1aca248829fb76808
Author: William Casarin <jb55@jb55.com>
Date: Sun, 15 Dec 2024 10:00:30 -0800
nostrdb: leak: fix memory leak when failing to write like stats
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/nostrdb/src/nostrdb.c b/nostrdb/src/nostrdb.c
@@ -2835,6 +2835,7 @@ static int ndb_write_reaction_stats(struct ndb_txn *txn, struct ndb_note *note)
if ((rc = mdb_put(txn->mdb_txn, txn->lmdb->dbs[NDB_DB_META], &key, &val, 0))) {
ndb_debug("write reaction stats to db failed: %s\n", mdb_strerror(rc));
+ free(root);
return 0;
}