]> git.alsa-project.org Git - alsa-lib.git/commitdiff
fix memory leak in snd_config_update_r error path
authorClemens Ladisch <clemens@ladisch.de>
Mon, 14 Jan 2008 07:53:06 +0000 (08:53 +0100)
committerClemens Ladisch <clemens@ladisch.de>
Mon, 14 Jan 2008 07:53:06 +0000 (08:53 +0100)
Do not forget to free the memory for the file name when a file to be
read by snd_config_update_r() cannot be accessed.

src/conf.c

index 4389c97769d64100fab1d9844091b4fd6e43a1d8..32a76085034600f937bd16412b25f818af5962a0 100644 (file)
@@ -3007,6 +3007,7 @@ int snd_config_update_r(snd_config_t **_top, snd_config_update_t **_update, cons
                        lf->mtime = st.st_mtime;
                } else {
                        SNDERR("Cannot access file %s", lf->name);
+                       free(lf->name);
                        memmove(&local->finfo[k], &local->finfo[k+1], sizeof(struct finfo) * (local->count - k - 1));
                        k--;
                        local->count--;