diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-03-14 08:02:39 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2016-03-14 08:02:39 +0000 |
| commit | 3ab1dc435d167f36002df4ec81e5a17f3aead577 (patch) | |
| tree | b773f8b8059f2085603424392d396014bc92a25b /src | |
| parent | 1742aa3b10e8714691e742852426232ae546aba2 (diff) | |
| download | qmmp-3ab1dc435d167f36002df4ec81e5a17f3aead577.tar.gz qmmp-3ab1dc435d167f36002df4ec81e5a17f3aead577.tar.bz2 qmmp-3ab1dc435d167f36002df4ec81e5a17f3aead577.zip | |
fixed memory leak
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@6179 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src')
| -rw-r--r-- | src/plugins/Output/alsa/settingsdialog.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
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); } |
