From 4d56abe1898d26e0b90aec70185e85a13f7c1bae Mon Sep 17 00:00:00 2001 From: ngie Date: Fri, 10 Jun 2016 14:33:21 +0000 Subject: [PATCH] MFC r299490: r299490 (by cem): camcontrol(8): Fix another trivial double-free CID: 1331222 git-svn-id: svn://svn.freebsd.org/base/stable/10@301788 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sbin/camcontrol/fwdownload.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbin/camcontrol/fwdownload.c b/sbin/camcontrol/fwdownload.c index 2c2d12abc..80496069f 100644 --- a/sbin/camcontrol/fwdownload.c +++ b/sbin/camcontrol/fwdownload.c @@ -488,6 +488,7 @@ fw_validate_ibm(struct cam_device *dev, int retry_count, int timeout, int fd, CAM_EPF_ALL, stderr); cam_freeccb(ccb); + ccb = NULL; goto bailout; } @@ -549,7 +550,8 @@ fw_validate_ibm(struct cam_device *dev, int retry_count, int timeout, int fd, fprintf(stdout, "Firmware file is valid for this drive.\n"); retval = 0; bailout: - cam_freeccb(ccb); + if (ccb != NULL) + cam_freeccb(ccb); return (retval); } -- 2.45.0