Blame SOURCES/e2fsprogs-1.45.6-debugfs-fix-double-free-in-realloc-error-path-in-rea.patch

a77133
From 4126c63885388e568ade780e9fed6ede37faf978 Mon Sep 17 00:00:00 2001
a77133
From: Theodore Ts'o <tytso@mit.edu>
a77133
Date: Thu, 21 Jan 2021 16:01:14 -0500
a77133
Subject: [PATCH 16/46] debugfs: fix double free in realloc() error path in
a77133
 read_list()
a77133
Content-Type: text/plain
a77133
a77133
Fixes-Coverity-Bug: 1464575
a77133
Fixes-Coverity-Bug: 1464571
a77133
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
a77133
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
a77133
---
a77133
 debugfs/util.c | 6 ++----
a77133
 1 file changed, 2 insertions(+), 4 deletions(-)
a77133
a77133
diff --git a/debugfs/util.c b/debugfs/util.c
a77133
index 759bb392..091f6f65 100644
a77133
--- a/debugfs/util.c
a77133
+++ b/debugfs/util.c
a77133
@@ -545,10 +545,8 @@ errcode_t read_list(char *str, blk64_t **list, size_t *len)
a77133
 			goto err;
a77133
 		}
a77133
 		l = realloc(lst, sizeof(blk64_t) * (ln + y - x + 1));
a77133
-		if (l == NULL) {
a77133
-			retval = ENOMEM;
a77133
-			goto err;
a77133
-		}
a77133
+		if (l == NULL)
a77133
+			return ENOMEM;
a77133
 		lst = l;
a77133
 		for (; x <= y; x++)
a77133
 			lst[ln++] = x;
a77133
-- 
a77133
2.35.1
a77133