aboutsummaryrefslogtreecommitdiff
path: root/audio/audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/audio.c')
-rw-r--r--audio/audio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/audio/audio.c b/audio/audio.c
index f91e05b72c..8d1e4ad922 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1758,12 +1758,15 @@ static AudioState *audio_init(Audiodev *dev, Error **errp)
goto out;
}
s->dev = dev = e->dev;
+ QSIMPLEQ_REMOVE_HEAD(&default_audiodevs, next);
+ g_free(e);
drvname = AudiodevDriver_str(dev->driver);
driver = audio_driver_lookup(drvname);
if (!audio_driver_init(s, driver, dev, NULL)) {
break;
}
- QSIMPLEQ_REMOVE_HEAD(&default_audiodevs, next);
+ qapi_free_Audiodev(dev);
+ s->dev = NULL;
}
}