# HG changeset patch # User John Darrington # Date 1343514648 -7200 # Node ID 2d65f823588d4aa966d083bceae7e2b20277ffa3 # Parent f2da6ed0256ab2c3305613d6f82e544572eaa71a clean-temp: Fix memory leak. * lib/clean-temp.c (cleanup_temp_dir): Free also the 'subdirs' and 'files' members of tmpdir. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-07-28 John Darrington + + clean-temp: Fix memory leak. + * lib/clean-temp.c (cleanup_temp_dir): Free also the 'subdirs' and + 'files' members of tmpdir. + 2012-07-27 Jim Meyering maint.mk: new rule: refresh-gnulib-patches diff --git a/lib/clean-temp.c b/lib/clean-temp.c --- a/lib/clean-temp.c +++ b/lib/clean-temp.c @@ -556,7 +556,10 @@ } else cleanup_list.tempdir_list[i] = NULL; - /* Now only we can free the tmpdir->dirname and tmpdir itself. */ + /* Now only we can free the tmpdir->dirname, tmpdir->subdirs, + tmpdir->files, and tmpdir itself. */ + gl_list_free (tmpdir->files); + gl_list_free (tmpdir->subdirs); free (tmpdir->dirname); free (tmpdir); return err;