When target_offsets allocation fails execution goes to abort label, where elements from targets table are closed. Initialize targets table after allocation. Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- super-intel.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/super-intel.c b/super-intel.c index 40fd940..8dd0805 100644 --- a/super-intel.c +++ b/super-intel.c @@ -7724,6 +7724,9 @@ int save_backup_imsm(struct supertype *st, if (!targets) goto abort; + for (i = 0; i < new_disks; i++) + targets[i] = -1; + target_offsets = malloc(new_disks * sizeof(unsigned long long)); if (!target_offsets) goto abort; -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html