Browse code

fix leaks introduced by r3417.

git-svn: trunk@3424

Török Edvin authored on 2007/12/15 23:07:16
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Dec 15 15:22:54 EET 2007 (edwin)
2
+-----------------------------------
3
+  * libclamav/phishcheck.c: fix leaks introduced by r3417.
4
+
1 5
 Fri Dec 14 22:55:32 CET 2007 (tk)
2 6
 ---------------------------------
3 7
   * libclamav: improved filetype detection code; filetype definitions can now
... ...
@@ -1136,12 +1136,15 @@ static enum phish_status phishingCheck(const struct cl_engine* engine,struct url
1136 1136
 
1137 1137
 	if(!(phishy&DOMAIN_LISTED) &&
1138 1138
 		!domainlist_match(engine,host_url.displayLink.data,host_url.realLink.data,&urls->pre_fixup,1,&urls->flags)) {
1139
-			return CL_PHISH_CLEAN; /* domain not listed */
1139
+		free_if_needed(&host_url);
1140
+		return CL_PHISH_CLEAN; /* domain not listed */
1140 1141
 	}
1141 1142
 
1142 1143
 	/* link type filtering must occur after last domainlist_match */
1143
-	if(urls->link_type & LINKTYPE_IMAGE && !(urls->flags&CHECK_IMG_URL))
1144
+	if(urls->link_type & LINKTYPE_IMAGE && !(urls->flags&CHECK_IMG_URL)) {
1145
+		free_if_needed(&host_url);
1144 1146
 		return CL_PHISH_CLEAN;/* its listed, but this link type is filtered */
1147
+	}
1145 1148
 
1146 1149
 	if(urls->flags&CHECK_CLOAKING) {
1147 1150
 		/*Checks if URL is cloaked.