bhyve/audio: don't leak resources on failed initialization.

Coverity CID:	1402793
Approved by:	markj, jhb, bhyve
Differential Revision:	https://reviews.freebsd.org/D20841
This commit is contained in:
seanc 2019-07-03 17:24:24 +00:00
parent 9a499315ee
commit 88bb3225d5

View File

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