Module: wine Branch: master Commit: f91fa3722167f4ebefaa5fa9f856bd9a15ce7eb3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f91fa3722167f4ebefaa5fa9f8...
Author: Matteo Bruni mbruni@codeweavers.com Date: Tue Jun 24 22:25:26 2014 +0200
wpp: Properly free defines (Valgrind).
---
libs/wpp/preproc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/libs/wpp/preproc.c b/libs/wpp/preproc.c index 33f69c8..21830d6 100644 --- a/libs/wpp/preproc.c +++ b/libs/wpp/preproc.c @@ -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)