From 0c4247932246f9ada0f85805d28e52c5cff31342 Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 16 Nov 2001 08:49:19 -0800 Subject: [PATCH] [svn] Applied Edward Sabol's patch from <200106131813.f5DIDss1294858@alderaan.gsfc.nasa.gov>. It fixes a memory leak in url_equal, and comments it out, as it's unused. --- src/ChangeLog | 8 ++++++++ src/url.c | 4 ++++ src/url.h | 3 +++ 3 files changed, 15 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 29edda04..d7dbddb7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2001-06-08 Edward J. Sabol + + * url.c (url_equal): Fix a memory leak when parseurl returns an + error on the second URL. Also, since url_equal is not used at the + moment, do not compile it. + + * url.h: Ditto for the prototype of url_equal. + 2001-11-16 Hrvoje Niksic * html-parse.c (map_html_tags): Support XML-style empty tags. diff --git a/src/url.c b/src/url.c index 3e19c83a..cfa09f16 100644 --- a/src/url.c +++ b/src/url.c @@ -774,6 +774,8 @@ str_url (const struct urlinfo *u, int hide) Returns 1 if the URL1 is equivalent to URL2, 0 otherwise. Also return 0 on error. */ +/* Do not compile unused code. */ +#if 0 int url_equal (const char *url1, const char *url2) { @@ -792,6 +794,7 @@ url_equal (const char *url1, const char *url2) err = parseurl (url2, u2, 0); if (err != URLOK) { + freeurl (u1, 1); freeurl (u2, 1); return 0; } @@ -800,6 +803,7 @@ url_equal (const char *url1, const char *url2) freeurl (u2, 1); return res; } +#endif /* 0 */ urlpos * get_urls_file (const char *file) diff --git a/src/url.h b/src/url.h index c28cd956..c47da58c 100644 --- a/src/url.h +++ b/src/url.h @@ -104,7 +104,10 @@ int skip_uname PARAMS ((const char *)); uerr_t parseurl PARAMS ((const char *, struct urlinfo *, int)); char *str_url PARAMS ((const struct urlinfo *, int)); +/* url_equal is not currently used. */ +#if 0 int url_equal PARAMS ((const char *, const char *)); +#endif /* 0 */ urlpos *get_urls_file PARAMS ((const char *)); urlpos *get_urls_html PARAMS ((const char *, const char *, int, int *)); -- 2.39.2