mirror of
https://git.FreeBSD.org/src.git
synced 2025-02-02 17:08:56 +00:00
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:
parent
a9880bfe11
commit
c61b3f7de9
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user