coverity fix in alsa-libs
A message that is not in the archive (sent off-list or not yet received): [email protected]
At Thu, 18 Sep 2014 11:15:50 +0000 (GMT),
Quoted 7 lines · Renu Tyagi
Hi,
Bug type : missing freeing resources before returning in case of errors Files changed :sbase.cpcm_file.c
PFA patch
Quoted 5 lines
-------------------------------------------------------------------
Fromf201df1f5c5d129f21c663c81fdb495d9a3ca51eMon Sep 17 00:00:00 2001
From: renu tyagi <[email protected]>
Date: Thu, 18 Sep 2014 16:17:55 +0530
Subject: [PATCH 2/8] [sbase ,pcm_file] : freeing resources before returning in case of errors
Please just send the patch as is. We don't need any foreword. Also, if the changes cover over different areas, split the patch.
thanks,
Takashi
Quoted 44 lines
Signed-off-by renu tyagi <[email protected]>--- modules/mixer/simple/sbase.c | 1 + src/pcm/pcm_file.c | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-)modules/mixer/simple/sbase.c +1
-0@@ -377,6 +377,7 @@ static int simple_event_add1(snd_mixer_class_t *class,if (ctype !=SND_CTL_ELEM_TYPE_BOOLEAN ) { __invalid_type:snd_mixer_selem_id_free (id); +free (hsimple);return -EINVAL ; }break ;src/pcm/pcm_file.c +2
-1@@ -758,6 +758,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, ifd =open (ifname,O_RDONLY );/* TODO: mind blocking mode */ if (ifd <0 ) {SYSERR ("open %s for reading failed" , ifname); +free (file->fname);free (file);return -errno; }@@ -772,6 +773,7 @@ int snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, err =snd_pcm_new (&pcm,SND_PCM_TYPE_FILE , name, slave->stream, slave->mode);if (err <0 ) {free (file->fname); +free (file->ifname);free (file);return err; } --1.7.1
Thanks
Renu Tyagi