From 39d752b8f1153935651bc244835ca0fc583e1cbd Mon Sep 17 00:00:00 2001 From: Polonkai Gergely Date: Fri, 6 Apr 2012 19:47:32 +0000 Subject: [PATCH] Bugfix: GRegex created many times, but never freed --- wmud/game-networking.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wmud/game-networking.c b/wmud/game-networking.c index 6f0ca51..55d89c7 100644 --- a/wmud/game-networking.c +++ b/wmud/game-networking.c @@ -58,6 +58,8 @@ GSList *clients = NULL; */ static GSList *game_menu = NULL; +static GRegex *email_regex = NULL; + void wmud_client_interpret_newplayer_email(wmudClient *client); void wmud_client_interpret_newplayer_mailconfirm(wmudClient *client); @@ -107,7 +109,6 @@ static gboolean wmud_client_callback(GSocket *client_socket, GIOCondition condition, wmudClient *client) { GError *err = NULL; - GRegex *email_regex = g_regex_new("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$", G_REGEX_CASELESS, 0, NULL); if (condition & G_IO_HUP) { @@ -540,6 +541,7 @@ wmud_networking_init(guint port_number, GMainContext *game_context, GSList *menu game_menu = menu_items; + email_regex = g_regex_new("^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$", G_REGEX_CASELESS, 0, NULL); return TRUE; }