Fix a memory leak for ENCIOC_GETSTRING I introduced in r360171.

MFC after:	1 week
Sponsored by:	DARPA
This commit is contained in:
John Baldwin 2020-05-08 16:41:23 +00:00
parent 2fce4e8614
commit f721fcbccb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=360818

View File

@ -2958,7 +2958,7 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *sstr, int ioc)
ret = enc_runcmd(enc, cdb, 6, buf, &amt);
if (ret == 0 && ioc == ENCIOC_GETSTRING)
ret = copyout(buf, sstr->buf, sstr->bufsiz);
if (ioc == ENCIOC_SETSTRING)
if (ioc == ENCIOC_SETSTRING || ioc == ENCIOC_GETSTRING)
ENC_FREE(buf);
return (ret);
}