-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.7 2002/03/26 22:29:55 swa Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.8 2002/04/03 23:32:47 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
*
* Revisions :
* $Log: urlmatch.c,v $
+ * Revision 1.8 2002/04/03 23:32:47 jongfoster
+ * Fixing memory leak on error
+ *
* Revision 1.7 2002/03/26 22:29:55 swa
* we have a new homepage!
*
url->path = NULL;
url->pathlen = 0;
}
-#ifdef REGEX
if (url->path)
{
int errcode;
return JB_ERR_PARSE;
}
}
-#endif
if ((p = strchr(buf, ':')) == NULL)
{
url->port = 0;
{
freez(url->spec);
freez(url->path);
-#ifdef REGEX
regfree(url->preg);
freez(url->preg);
-#endif /* def REGEX */
return JB_ERR_MEMORY;
}
{
freez(url->spec);
freez(url->path);
-#ifdef REGEX
regfree(url->preg);
freez(url->preg);
-#endif /* def REGEX */
freez(url->dbuffer);
url->dcount = 0;
return JB_ERR_MEMORY;
{
freez(url->spec);
freez(url->path);
-#ifdef REGEX
regfree(url->preg);
freez(url->preg);
-#endif /* def REGEX */
freez(url->dbuffer);
url->dcount = 0;
return JB_ERR_MEMORY;
freez(url->dbuffer);
freez(url->dvec);
freez(url->path);
-#ifdef REGEX
if (url->preg)
{
regfree(url->preg);
freez(url->preg);
}
-#endif
-
}
return ((pattern->port == 0) || (pattern->port == url->port))
&& ((pattern->dbuffer == NULL) || (domain_match(pattern, url) == 0))
&& ((pattern->path == NULL) ||
-#ifdef REGEX
(regexec(pattern->preg, url->path, 0, NULL, 0) == 0)
-#else
- (strncmp(pattern->path, url->path, pattern->pathlen) == 0)
-#endif
);
}