From 3ab1dc435d167f36002df4ec81e5a17f3aead577 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 14 Mar 2016 08:02:39 +0000 Subject: fixed memory leak git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6179 90c681e8-e032-0410-971d-27865f9a5e38 --- src/plugins/Output/alsa/settingsdialog.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/plugins/Output/alsa') diff --git a/src/plugins/Output/alsa/settingsdialog.cpp b/src/plugins/Output/alsa/settingsdialog.cpp index 20b0aa5c0..ea4d6945e 100644 --- a/src/plugins/Output/alsa/settingsdialog.cpp +++ b/src/plugins/Output/alsa/settingsdialog.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2006-2012 by Ilya Kotov * + * Copyright (C) 2006-2016 by Ilya Kotov * * forkotov02@hotmail.ru * * * * This program is free software; you can redistribute it and/or modify * @@ -236,10 +236,8 @@ void SettingsDialog::accept() int SettingsDialog::getMixer(snd_mixer_t **mixer, QString card) { - char *dev; int err; - dev = strdup(QString(card).toAscii().data()); if ((err = snd_mixer_open(mixer, 0)) < 0) { qWarning("SettingsDialog (ALSA): alsa_get_mixer(): " @@ -247,10 +245,10 @@ int SettingsDialog::getMixer(snd_mixer_t **mixer, QString card) mixer = NULL; return -1; } - if ((err = snd_mixer_attach(*mixer, dev)) < 0) + if ((err = snd_mixer_attach(*mixer, card.toAscii().constData())) < 0) { qWarning("SettingsDialog (ALSA): alsa_get_mixer(): " - "Attaching to mixer %s failed: %s", dev, snd_strerror(-err)); + "Attaching to mixer %s failed: %s", qPrintable(card), snd_strerror(-err)); return -1; } if ((err = snd_mixer_selem_register(*mixer, NULL, NULL)) < 0) @@ -266,8 +264,6 @@ int SettingsDialog::getMixer(snd_mixer_t **mixer, QString card) return -1; } - free (dev); - return (*mixer != NULL); } -- cgit v1.2.3-13-gbd6f