From: Clemens Ladisch Date: Mon, 14 Jan 2008 07:53:06 +0000 (+0100) Subject: fix memory leak in snd_config_update_r error path X-Git-Tag: v1.0.16rc1~7 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=50ce5d049e1319fe30445fb3424a36027b4e8a4c;p=alsa-lib.git fix memory leak in snd_config_update_r error path 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. --- diff --git a/src/conf.c b/src/conf.c index 4389c977..32a76085 100644 --- a/src/conf.c +++ b/src/conf.c @@ -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--;