Fix a memory leak in an error case in libctf.

Submitted by:	Tom Rix <trix@juniper.net>
MFC after:	1 week
This commit is contained in:
Mark Johnston 2017-02-23 17:54:17 +00:00
parent d751009457
commit 74d9553e43
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=314153

View File

@ -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));
}