summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorRichardHitt <rbh00@netcom.com>2013-02-13 12:52:49 -0800
committerRichardHitt <rbh00@netcom.com>2013-02-13 12:52:49 -0800
commit8e3d0391995f9e935efb6049d8d0bcfedf184a54 (patch)
treeb76fa0eb0830b848a268cc882b8daef16419ce89 /src
parentef18734f2042ce8bfd11cc508bc803de555e495a (diff)
Fix bug in url.c at re_host().
Unlike the other re_foo() functions it was not checking immediately
and returning if host_ret had already been filled in.  This would
causes a memory leak since the previous GRegex would be lost.
Diffstat (limited to 'src')
-rw-r--r--src/common/url.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/url.c b/src/common/url.c
index dad23b67..6bd7d9ff 100644
--- a/src/common/url.c
+++ b/src/common/url.c
@@ -371,6 +371,9 @@ re_host (void)
 {
 	static GRegex *host_ret;
 	char *grist;
+
+	if (host_ret) return host_ret;
+
 	grist = g_strdup_printf (
 		"("	/* HOST */
 			HOST OPT_PORT