From: ratchov Date: Tue, 15 Mar 2022 05:53:37 +0000 (+0000) Subject: Fix crash caused by confusion between requested device and last used one X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1d8c7cc522ac7bec41e7e1927cba9b27149f331f;p=openbsd Fix crash caused by confusion between requested device and last used one Found by and ok semarie@ --- diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c index b63af2248b1..b9f244be7bb 100644 --- a/usr.bin/sndiod/dev.c +++ b/usr.bin/sndiod/dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.103 2021/11/01 14:43:24 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.104 2022/03/15 05:53:37 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov * @@ -1776,7 +1776,7 @@ slot_new(struct opt *opt, unsigned int id, char *who, found: /* open device, this may change opt's device */ - if (!opt_ref(s->opt)) + if (!opt_ref(opt)) return NULL; s->opt = opt; s->ops = ops;