mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl_helper.device-mapper: Fix segmentation fault in an error path
Fix segmentation fault when trying to process not supported dm-targets Release allocated memory in error paths Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com> Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>
This commit is contained in:
committed by
Steffen Eiden
parent
e1692b7079
commit
d6f7eff5b5
@@ -1045,6 +1045,8 @@ static int get_table(dev_t dev, struct util_list **table)
|
||||
&start, &length, &type, &args) < 4) {
|
||||
ERR("Unrecognized device-mapper table format for device '%s'\n",
|
||||
devname);
|
||||
free(type);
|
||||
free(args);
|
||||
goto out;
|
||||
}
|
||||
tops = find_target_ops(type);
|
||||
@@ -1052,6 +1054,9 @@ static int get_table(dev_t dev, struct util_list **table)
|
||||
ERR("Unsupported setup: Unsupported device-mapper "
|
||||
"target type '%s' for device '%s'\n",
|
||||
type, devname);
|
||||
free(type);
|
||||
free(args);
|
||||
goto out;
|
||||
}
|
||||
data = tops->get_target_data(devname, args);
|
||||
free(type);
|
||||
|
||||
Reference in New Issue
Block a user