From 1d8c7cc522ac7bec41e7e1927cba9b27149f331f Mon Sep 17 00:00:00 2001 From: ratchov Date: Tue, 15 Mar 2022 05:53:37 +0000 Subject: [PATCH] Fix crash caused by confusion between requested device and last used one Found by and ok semarie@ --- usr.bin/sndiod/dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1