]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm_file: fixed missing free
authorRenu Tyagi <renu.tyagi@samsung.com>
Tue, 23 Sep 2014 07:04:19 +0000 (09:04 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 23 Sep 2014 07:04:19 +0000 (09:04 +0200)
Signed-off-by: renu tyagi <renu.tyagi@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm_file.c

index 5541a939502778d756b59d49badd8365b960b9a7..9ab6964d3520b42fa317e4f66b4820522a7f2e3f 100644 (file)
@@ -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;
        }