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:25:33 +0000
commit2b25564af6f9d1303fb92b8dfd3a36f5d7fc3c34 (patch)
tree66bb2f12f0108730ccbc5e1f7e441fd382bb8c7c
parent4aee71578a60981de9296451b7a995b180ae23db (diff)
downloadsrc-2b25564af6f9d1303fb92b8dfd3a36f5d7fc3c34.tar.gz
src-2b25564af6f9d1303fb92b8dfd3a36f5d7fc3c34.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) (cherry picked from commit 889dcb5e9b2ff4160c313b31cfa53106af2a5b0c)
-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);
}