Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cac906a
)
tdb_transaction_recover: fix memory leak
author
wuguanghao
<wuguanghao3@huawei.com>
Wed, 30 Jun 2021 08:27:14 +0000
(16:27 +0800)
committer
Theodore Ts'o
<tytso@mit.edu>
Fri, 16 Jul 2021 03:19:26 +0000
(23:19 -0400)
In tdb_transaction_recover(), need free data before return,
otherwise it will cause memory leak.
Signed-off-by: Wu Guanghao <wuguanghao3@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: Wu Bo <wubo40@huawei.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/tdb.c
patch
|
blob
|
history
diff --git
a/lib/ext2fs/tdb.c
b/lib/ext2fs/tdb.c
index
5091b12
..
0fb9481
100644
(file)
--- a/
lib/ext2fs/tdb.c
+++ b/
lib/ext2fs/tdb.c
@@
-2186,6
+2186,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;
}