Don't free k_cfg until we're finished using it -- reverse the order of

two free commands.

Reported by:	"Ted Unangst" <tedu@coverity.com>
Approved by:	rwatson (mentor), scottl
This commit is contained in:
Colin Percival 2004-02-22 09:55:48 +00:00
parent caa32ef5c2
commit 1f0c8eae54

View File

@ -515,9 +515,9 @@ raidctlioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct thread *td)
(caddr_t) specific_buf,
k_cfg->layoutSpecificSize);
if (retcode) {
RF_Free(k_cfg, sizeof(RF_Config_t));
RF_Free(specific_buf,
k_cfg->layoutSpecificSize);
RF_Free(k_cfg, sizeof(RF_Config_t));
rf_printf(2, "raidctlioctl: retcode=%d "
"copyin.2\n", retcode);
return (retcode);