Author: seanc (ports committer)
Date: Wed Jul  3 17:24:24 2019
New Revision: 349656
URL: https://svnweb.freebsd.org/changeset/base/349656

Log:
  bhyve/audio: don't leak resources on failed initialization.
  
  Coverity CID: 1402793
  Approved by:  markj, jhb, bhyve
  Differential Revision:        https://reviews.freebsd.org/D20841

Modified:
  head/usr.sbin/bhyve/audio.c

Modified: head/usr.sbin/bhyve/audio.c
==============================================================================
--- head/usr.sbin/bhyve/audio.c Wed Jul  3 17:09:41 2019        (r349655)
+++ head/usr.sbin/bhyve/audio.c Wed Jul  3 17:24:24 2019        (r349656)
@@ -103,6 +103,7 @@ audio_init(const char *dev_name, uint8_t dir)
        if (aud->fd == -1) {
                DPRINTF("Failed to open dev: %s, errno: %d\n",
                    aud->dev_name, errno);
+               free(aud);
                return (NULL);
        }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to