OpenBSM: fix free() in au_read_rec error case

buf is a char ** and *buf is the allocated buffer.

PR:		267050
Reported by:	Robert Morris <rtm@lcs.mit.edu>
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Ed Maste 2022-10-24 09:45:59 -04:00
parent a9880bfe11
commit c61b3f7de9

View File

@ -4597,7 +4597,7 @@ au_read_rec(FILE *fp, u_char **buf)
if (fread(bptr, 1, ntohs(filenamelen), fp) <
ntohs(filenamelen)) {
free(buf);
free(*buf);
errno = EINVAL;
return (-1);
}