From b95dd7ef468212c08434f6e7b9987f2936944b09 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Wed, 3 Apr 2013 11:57:52 +0200 Subject: [PATCH] alsactl: small code reorder to avoid memory leaks Signed-off-by: Jaroslav Kysela --- alsactl/state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alsactl/state.c b/alsactl/state.c index 1eab02e..8b309ba 100644 --- a/alsactl/state.c +++ b/alsactl/state.c @@ -185,11 +185,11 @@ static int add_tlv_comments(snd_ctl_t *handle, snd_ctl_elem_id_t *id, char *s = tlv_to_str(tlv); if (s) { err = snd_config_string_add(comment, "tlv", s); + free(s); if (err < 0) { error("snd_config_string_add: %s", snd_strerror(err)); return err; } - free(s); } }