1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

don't try to sio_close a NULL sio_hdl. stops cdio from segfaulting

when /dev/audio is busy or AUDIODEVICE is not set correctly.

commit it!  ratchov@
This commit is contained in:
jakemsr 2008-12-11 10:59:49 +00:00
parent b870899e51
commit c6db944c23

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rip.c,v 1.9 2008/11/29 08:57:10 jakemsr Exp $ */
/* $OpenBSD: rip.c,v 1.10 2008/12/11 10:59:49 jakemsr Exp $ */
/*
* Copyright (c) 2007 Alexey Vatchenko <av@bsdua.org>
@ -503,8 +503,10 @@ play_next_track(struct track_info *info)
return (NXTRACK_OK);
bad:
sio_close(info->hdl);
info->hdl = NULL;
if (info->hdl != NULL) {
sio_close(info->hdl);
info->hdl = NULL;
}
return (NXTRACK_FAIL);
}