All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] confmisc: fix memory leak in snd_func_concat
@ 2020-12-28  1:43 Alex Henrie
  2020-12-29  8:23 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Henrie @ 2020-12-28  1:43 UTC (permalink / raw)
  To: alsa-devel, perex, tiwai; +Cc: Alex Henrie

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 src/confmisc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/confmisc.c b/src/confmisc.c
index eb8218c1..3ce95c7a 100644
--- a/src/confmisc.c
+++ b/src/confmisc.c
@@ -419,7 +419,6 @@ int snd_func_concat(snd_config_t **dst, snd_config_t *root, snd_config_t *src,
 				tmp = realloc(res, len + len1 + 1);
 				if (tmp == NULL) {
 					free(ptr);
-					free(res);
 					err = -ENOMEM;
 					goto __error;
 				}
@@ -440,8 +439,8 @@ int snd_func_concat(snd_config_t **dst, snd_config_t *root, snd_config_t *src,
 	err = snd_config_get_id(src, &id);
 	if (err >= 0)
 		err = snd_config_imake_string(dst, id, res);
-	free(res);
       __error:
+	free(res);
 	return err;
 }
 #ifndef DOC_HIDDEN
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] confmisc: fix memory leak in snd_func_concat
  2020-12-28  1:43 [PATCH v2] confmisc: fix memory leak in snd_func_concat Alex Henrie
@ 2020-12-29  8:23 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2020-12-29  8:23 UTC (permalink / raw)
  To: Alex Henrie; +Cc: alsa-devel

On Mon, 28 Dec 2020 02:43:15 +0100,
Alex Henrie wrote:
> 
> Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>

Thanks, applied.


Takashi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-29  8:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-28  1:43 [PATCH v2] confmisc: fix memory leak in snd_func_concat Alex Henrie
2020-12-29  8:23 ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.