diff options
author | emaste <emaste@FreeBSD.org> | 2011-11-23 17:02:27 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2011-11-23 17:02:27 +0000 |
commit | d213dca17e7d1aaff815178dbdbc90e9ef95f20a (patch) | |
tree | b312e828b721b3cf94dd2639595c6e0787e9a7c0 /usr.sbin | |
parent | fe3a1e2f9d4008e82270bec9e315f5ad26e1aaa1 (diff) | |
download | FreeBSD-src-d213dca17e7d1aaff815178dbdbc90e9ef95f20a.zip FreeBSD-src-d213dca17e7d1aaff815178dbdbc90e9ef95f20a.tar.gz |
Avoid double free creating a new RAID with invalid command line arguments.
Submitted by: Xin Huang <xhuang sandvine com>
Reviewed by: rstone@
MFC after: 1 week
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/mfiutil/mfi_config.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.sbin/mfiutil/mfi_config.c b/usr.sbin/mfiutil/mfi_config.c index f6f1a9d..ba6ce2d 100644 --- a/usr.sbin/mfiutil/mfi_config.c +++ b/usr.sbin/mfiutil/mfi_config.c @@ -348,6 +348,7 @@ parse_array(int fd, int raid_type, char *array_str, struct array_info *info) error = mfi_lookup_drive(fd, cp, &device_id); if (error) { free(info->drives); + info->drives = NULL; return (error); } @@ -355,12 +356,14 @@ parse_array(int fd, int raid_type, char *array_str, struct array_info *info) error = errno; warn("Failed to fetch drive info for drive %s", cp); free(info->drives); + info->drives = NULL; return (error); } if (pinfo->fw_state != MFI_PD_STATE_UNCONFIGURED_GOOD) { warnx("Drive %u is not available", device_id); free(info->drives); + info->drives = NULL; return (EINVAL); } } |