[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH 10/11] gfs2_edit: Fix resource leak in print_block_details()



Spotted by coverity: Variable "more_indir" going out of scope leaks the
storage it points to.

Signed-off-by: Andrew Price <anprice redhat com>
---
 gfs2/edit/extended.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/gfs2/edit/extended.c b/gfs2/edit/extended.c
index 7c0ced5..1066e1b 100644
--- a/gfs2/edit/extended.c
+++ b/gfs2/edit/extended.c
@@ -396,6 +396,7 @@ static void print_block_details(struct iinfo *ind, int level, int cur_height,
 	if (!tmpbuf) {
 		fprintf(stderr, "Out of memory in function "
 			"display_indirect\n");
+		free(more_indir);
 		return;
 	}
 	while (thisblk) {
-- 
1.7.6.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]