Commit f91fa372 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wpp: Properly free defines (Valgrind).

parent c8c609b5
......@@ -292,7 +292,7 @@ void pp_pop_define_state(void)
for (i = 0; i < HASHKEY; i++)
{
while ((ppp = pp_def_state->defines[i]) != NULL) free_pp_entry( ppp, i );
while ((ppp = pp_def_state->defines[i]) != NULL) pp_del_define( ppp->ident );
}
state = pp_def_state;
pp_def_state = state->next;
......@@ -302,6 +302,7 @@ void pp_pop_define_state(void)
void pp_del_define(const char *name)
{
pp_entry_t *ppp;
int idx = pphash(name);
if((ppp = pplookup(name)) == NULL)
{
......@@ -310,13 +311,13 @@ void pp_del_define(const char *name)
return;
}
if(pp_status.debug)
printf("Deleting (%s, %d) <%s>\n", pp_status.input, pp_status.line_number, name);
free( ppp->ident );
free( ppp->subst.text );
free( ppp->filename );
free_pp_entry( ppp, pphash(name) );
if(pp_status.debug)
printf("Deleted (%s, %d) <%s>\n", pp_status.input, pp_status.line_number, name);
free_pp_entry( ppp, idx );
}
pp_entry_t *pp_add_define(const char *def, const char *text)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment