- Backport upstream fixes: A couple of USB-audio config addition/fix, dmix PCM stop fix, a memory leak fix, DSD format endianess fix, PCM timestamp fixes, etc. 0050-USB-Audio-Add-Scarlett-2i4-USB-to-S-PDIF-blacklist.patch 0051-snd_user_file-fix-memory-leak.patch 0052-pcm-dmix-Don-t-ignore-SND_TIMER_EVENT_MSTOP.patch 0053-snd_dlsym-only-do-versioning-checks-if-built-with-ve.patch 0054-dlmisc-Remove-unused-label.patch 0055-USB-audio-Add-five-more-cards-to-IEC958-blacklist.patch 0056-pcm-Fix-DSD-sample-format-endianess-and-add-big-endi.patch 0057-mixer-Fix-inclusion-of-config.h.patch 0058-mixer-Fix-unused-parameter-warnings.patch 0059-ucm-Fix-uninitialized-err-in-snd_use_case_set.patch 0060-pcm-Fix-assorted-tstamp_type-bugs-omissions.patch OBS-URL: https://build.opensuse.org/request/show/264171 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=174
44 lines
1.0 KiB
Diff
44 lines
1.0 KiB
Diff
From c7bfcbb25548db39299488e285b510a174231076 Mon Sep 17 00:00:00 2001
|
|
From: Andreas Schwab <schwab@suse.de>
|
|
Date: Mon, 3 Nov 2014 17:22:28 +0100
|
|
Subject: [PATCH 51/60] snd_user_file: fix memory leak
|
|
|
|
Call wordfree if and only if wordfree returns zero or WRDE_NOSPACE
|
|
|
|
Signed-off-by: Andreas Schwab <schwab@suse.de>
|
|
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
|
---
|
|
src/userfile.c | 5 +++--
|
|
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/userfile.c b/src/userfile.c
|
|
index 3a738366f1ea..72779da4ebaf 100644
|
|
--- a/src/userfile.c
|
|
+++ b/src/userfile.c
|
|
@@ -44,19 +44,20 @@ int snd_user_file(const char *file, char **result)
|
|
err = wordexp(file, &we, WRDE_NOCMD);
|
|
switch (err) {
|
|
case WRDE_NOSPACE:
|
|
+ wordfree(&we);
|
|
return -ENOMEM;
|
|
case 0:
|
|
if (we.we_wordc == 1)
|
|
break;
|
|
+ wordfree(&we);
|
|
/* fall thru */
|
|
default:
|
|
- wordfree(&we);
|
|
return -EINVAL;
|
|
}
|
|
*result = strdup(we.we_wordv[0]);
|
|
+ wordfree(&we);
|
|
if (*result == NULL)
|
|
return -ENOMEM;
|
|
- wordfree(&we);
|
|
return 0;
|
|
}
|
|
|
|
--
|
|
2.1.3
|
|
|