]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
debugfs: fix double free in realloc() error path in read_list()
authorTheodore Ts'o <tytso@mit.edu>
Thu, 21 Jan 2021 21:01:14 +0000 (16:01 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 21 Jan 2021 21:01:14 +0000 (16:01 -0500)
Fixes-Coverity-Bug: 1464575
Fixes-Coverity-Bug: 1464571
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/util.c

index da3a7ef761b8a0c072c3bd653a07d779a0abc525..fb05e897bbeeef007d6d1d2dfc6f52afe2f3cb6c 100644 (file)
@@ -545,10 +545,8 @@ errcode_t read_list(char *str, blk64_t **list, size_t *len)
                        goto err;
                }
                l = realloc(lst, sizeof(blk64_t) * (ln + y - x + 1));
-               if (l == NULL) {
-                       retval = ENOMEM;
-                       goto err;
-               }
+               if (l == NULL)
+                       return ENOMEM;
                lst = l;
                for (; x <= y; x++)
                        lst[ln++] = x;