Date: Tue, 12 Nov 2019 23:09:56 +0000 (UTC) From: Alan Somers <asomers@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354665 - head/usr.sbin/sesutil Message-ID: <201911122309.xACN9uKk064856@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: asomers Date: Tue Nov 12 23:09:55 2019 New Revision: 354665 URL: https://svnweb.freebsd.org/changeset/base/354665 Log: sesutil: fix some memory leaks Reported by: Coverity Coverity CID: 1331665 MFC after: 2 weeks Sponsored by: Axcient Modified: head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Tue Nov 12 23:03:52 2019 (r354664) +++ head/usr.sbin/sesutil/sesutil.c Tue Nov 12 23:09:55 2019 (r354665) @@ -242,18 +242,21 @@ sesled(int argc, char **argv, bool setfault) } if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) objp) < 0) { + free(objp); close(fd); xo_err(EXIT_FAILURE, "ENCIOC_GETELMMAP"); } if (isses) { if (sesid >= nobj) { + free(objp); close(fd); xo_errx(EXIT_FAILURE, "Requested SES ID does not exist"); } do_led(fd, sesid, objp[sesid].elm_type, onoff, setfault); ndisks++; + free(objp); close(fd); break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911122309.xACN9uKk064856>