Date: Fri, 2 Nov 2018 08:01:42 +0000 (UTC) From: Marcelo Araujo <araujo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r340044 - head/usr.sbin/bhyve Message-ID: <201811020801.wA281ghr037784@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: araujo Date: Fri Nov 2 08:01:42 2018 New Revision: 340044 URL: https://svnweb.freebsd.org/changeset/base/340044 Log: Fix resource leak when using strdup(3). Reported by: Coverity CID: 1357336 Sponsored by: iXsystems Inc. Modified: head/usr.sbin/bhyve/pci_xhci.c Modified: head/usr.sbin/bhyve/pci_xhci.c ============================================================================== --- head/usr.sbin/bhyve/pci_xhci.c Fri Nov 2 07:59:28 2018 (r340043) +++ head/usr.sbin/bhyve/pci_xhci.c Fri Nov 2 08:01:42 2018 (r340044) @@ -2700,6 +2700,8 @@ pci_xhci_parse_opts(struct pci_xhci_softc *sc, char *o sc->ndevices++; } + if (uopt != NULL) + free(uopt); portsfinal: sc->portregs = calloc(XHCI_MAX_DEVS, sizeof(struct pci_xhci_portregs)); @@ -2729,6 +2731,7 @@ done: free(devices); } } + free(uopt); return (sc->ndevices); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811020801.wA281ghr037784>