aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib/libctf/common
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2017-02-23 17:54:17 +0000
committerMark Johnston <markj@FreeBSD.org>2017-02-23 17:54:17 +0000
commit74d9553e43cfafc29448d0bb836916aa21dea0de (patch)
treebed1df3588a30058d6d61e230807d957d7384f2a /cddl/contrib/opensolaris/lib/libctf/common
parentd7510094575b2d64aedc514a101947bb8f82951c (diff)
downloadsrc-74d9553e43cfafc29448d0bb836916aa21dea0de.tar.gz
src-74d9553e43cfafc29448d0bb836916aa21dea0de.zip
Fix a memory leak in an error case in libctf.
Submitted by: Tom Rix <trix@juniper.net> MFC after: 1 week
Notes
Notes: svn path=/head/; revision=314153
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libctf/common')
-rw-r--r--cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c b/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
index b9f512d37739..f0842c10e48e 100644
--- a/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
+++ b/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
@@ -346,6 +346,7 @@ ctf_fdopen(int fd, int *errp)
if ((sp32 = malloc(nbytes)) == NULL || pread64(fd,
sp32, nbytes, hdr.e64.e_shoff) != nbytes) {
free(sp);
+ free(sp32);
return (ctf_set_open_errno(errp, errno));
}