f74d565ff8
resolves: rhbz#1938798
29 lines
836 B
Diff
29 lines
836 B
Diff
From 252275f3a6b5d81d23ca0eb35bcb67c2d01dd807 Mon Sep 17 00:00:00 2001
|
|
From: Andreas Schneider <asn@samba.org>
|
|
Date: Wed, 7 Jul 2021 11:12:37 +0200
|
|
Subject: [PATCH] lib:tdb: Fix a memory leak on error
|
|
|
|
Found by covscan.
|
|
|
|
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
Reviewed-by: Stefan Metzmacher <metze@samba.org>
|
|
---
|
|
lib/tdb/common/transaction.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c
|
|
index 4f8d1f8cdcc..5ab38d0809f 100644
|
|
--- a/common/transaction.c
|
|
+++ b/common/transaction.c
|
|
@@ -1301,6 +1301,7 @@ int tdb_transaction_recover(struct tdb_context *tdb)
|
|
rec.data_len, 0) == -1) {
|
|
TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to read recovery data\n"));
|
|
tdb->ecode = TDB_ERR_IO;
|
|
+ free(data);
|
|
return -1;
|
|
}
|
|
|
|
--
|
|
GitLab
|
|
|