diff options
author | Xiao Ni <xni@redhat.com> | 2024-07-26 09:14:16 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-08-05 11:14:30 +0200 |
commit | ae2308ddf38b8f24a2b5e8e14e31153dfe608239 (patch) | |
tree | f4b44a874d801f419a20da2623dad0d994d9b128 | |
parent | mdadm/super1: fix coverity issue EVALUATION_ORDER (diff) | |
download | mdadm-ae2308ddf38b8f24a2b5e8e14e31153dfe608239.tar.xz mdadm-ae2308ddf38b8f24a2b5e8e14e31153dfe608239.zip |
mdadm/super1: fix coverity issue RESOURCE_LEAK
Fix resource leak problems in super1.c
Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
-rw-r--r-- | super1.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -923,10 +923,12 @@ static int examine_badblocks_super1(struct supertype *st, int fd, char *devname) offset <<= 9; if (lseek64(fd, offset, 0) < 0) { pr_err("Cannot seek to bad-blocks list\n"); + free(bbl); return 1; } if (read(fd, bbl, size) != size) { pr_err("Cannot read bad-blocks list\n"); + free(bbl); return 1; } /* 64bits per entry. 10 bits is block-count, 54 bits is block @@ -947,6 +949,7 @@ static int examine_badblocks_super1(struct supertype *st, int fd, char *devname) printf("%20llu for %d sectors\n", sector, count); } + free(bbl); return 0; } |