[alsa-devel] [PATCH v2 02/11] pcm_file : fixed missing free

Renu Tyagi renu.tyagi at samsung.com
Tue Sep 23 06:18:17 CEST 2014


Signed-off-by: renu tyagi <renu.tyagi at samsung.com>
---
 src/pcm/pcm_file.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/pcm/pcm_file.c b/src/pcm/pcm_file.c
index a0b8bf4..f6d222f 100644
--- a/src/pcm/pcm_file.c
+++ b/src/pcm/pcm_file.c
@@ -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


More information about the Alsa-devel mailing list