1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-01 22:28:02 +02:00

yat2m: don't dereference pointer to freed memory

* doc/yat2m.c (top_parse_file): Correct macrolist-freeing loop.
This commit is contained in:
Jim Meyering 2012-01-14 22:34:58 +01:00 committed by Werner Koch
parent 37801918cb
commit 4402dc3f0a

View File

@ -1203,10 +1203,10 @@ top_parse_file (const char *fname, FILE *fp)
if not in a section. */
while (macrolist)
{
macro_t m = macrolist->next;
free (m->value);
free (m);
macrolist = m;
macro_t next = macrolist->next;
free (macrolist->value);
free (macrolist);
macrolist = next;
}
parse_file (fname, fp, &section_name, 0);