aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2022-10-24 13:45:59 +0000
committerEd Maste <emaste@FreeBSD.org>2022-10-27 00:24:07 +0000
commit889dcb5e9b2ff4160c313b31cfa53106af2a5b0c (patch)
tree470434034425f4fe867318735ad8ee1333eeb31a
parent75f9d5c7e36b452f4f76356dfeb8bba51d64e51b (diff)
downloadsrc-889dcb5e9b2ff4160c313b31cfa53106af2a5b0c.tar.gz
src-889dcb5e9b2ff4160c313b31cfa53106af2a5b0c.zip
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 (cherry picked from commit c61b3f7de9a0a39d2bc78e3e78d148c369e706a5)
-rw-r--r--contrib/openbsm/libbsm/bsm_io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/openbsm/libbsm/bsm_io.c b/contrib/openbsm/libbsm/bsm_io.c
index 43cf7e9990c1..4b89ccb8b59c 100644
--- a/contrib/openbsm/libbsm/bsm_io.c
+++ b/contrib/openbsm/libbsm/bsm_io.c
@@ -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);
}