mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
dasdinfo: Fix memory leak by freeing readbuf
Reviewed-by: Jan Höppner <hoeppner@linux.ibm.com> Signed-off-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
522c67a2c3
commit
35d68b2101
@@ -364,12 +364,16 @@ static int dinfo_get_dev_from_blockdev(char *blockdev, dev_t *dev)
|
||||
path = util_path_sysfs("block/%s/dev", blockdev);
|
||||
if (util_file_read_line(readbuf, RD_BUFFER_SIZE, path) < 0) {
|
||||
free(path);
|
||||
free(readbuf);
|
||||
return -1;
|
||||
}
|
||||
free(path);
|
||||
if (dinfo_extract_dev(dev, readbuf) != 0)
|
||||
if (dinfo_extract_dev(dev, readbuf) != 0) {
|
||||
free(readbuf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
free(readbuf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user