[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690

Alexandre Julliard julliard at winehq.org
Sun Jun 17 20:01:21 UTC 2012


The following commit has been merged in the wheezy branch:
commit 94cfb624eb252b3adcae8065e9bf36e7869e3c02
Author: Józef Kucia <joseph.kucia at gmail.com>
Date:   Sun Mar 25 15:53:31 2012 +0200

    wpp: Fix a few memory leaks in the wpp_parse() function.
    (cherry picked from commit 2c8a3c31b732b048a05fcb3e9756b76f9a57e973)

diff --git a/libs/wpp/wpp.c b/libs/wpp/wpp.c
index 0c9c808..66eb026 100644
--- a/libs/wpp/wpp.c
+++ b/libs/wpp/wpp.c
@@ -49,6 +49,16 @@ static void add_cmdline_defines(void)
     }
 }
 
+static void del_cmdline_defines(void)
+{
+    struct define *def;
+
+    for (def = cmdline_defines; def; def = def->next)
+    {
+        if (def->value) pp_del_define( def->name );
+    }
+}
+
 static void add_special_defines(void)
 {
     time_t now = time(NULL);
@@ -70,6 +80,14 @@ static void add_special_defines(void)
         ppp->type = def_special;
 }
 
+static void del_special_defines(void)
+{
+    pp_del_define( "__DATE__" );
+    pp_del_define( "__TIME__" );
+    pp_del_define( "__FILE__" );
+    pp_del_define( "__LINE__" );
+}
+
 
 /* add a define to the preprocessor list */
 int wpp_add_define( const char *name, const char *value )
@@ -182,6 +200,8 @@ int wpp_parse( const char *input, FILE *output )
     else if (!(pp_status.file = wpp_callbacks->open(input, 1)))
     {
         ppy_error("Could not open %s\n", input);
+        del_special_defines();
+        del_cmdline_defines();
         pp_pop_define_state();
         return 2;
     }
@@ -198,6 +218,8 @@ int wpp_parse( const char *input, FILE *output )
     if (input) wpp_callbacks->close(pp_status.file);
     /* Clean if_stack, it could remain dirty on errors */
     while (pp_get_if_depth()) pp_pop_if();
+    del_special_defines();
+    del_cmdline_defines();
     pp_pop_define_state();
     return ret;
 }

-- 
Debian Wine packaging



More information about the pkg-wine-party mailing list