[Pidgin] #16124: Possible memory leak in http.c/purple_http_url_parse

Pidgin trac at pidgin.im
Sun Mar 9 17:34:45 EDT 2014


#16124: Possible memory leak in http.c/purple_http_url_parse
--------------------------------+-------------------------
 Reporter:  AnonymousSubmitter  |      Owner:
     Type:  defect              |     Status:  new
Milestone:                      |  Component:  libpurple
  Version:  2.10.9              |   Keywords:  leak memory
--------------------------------+-------------------------
 Hi,


 {{{
 PurpleHttpURL *
 purple_http_url_parse(const char *raw_url)
 {
         PurpleHttpURL *url;
         GMatchInfo *match_info;

         gchar *host_full, *tmp;

         g_return_val_if_fail(raw_url != NULL, NULL);

         url = g_new0(PurpleHttpURL, 1);

         if (!g_regex_match(purple_http_re_url, raw_url, 0, &match_info)) {
                 if (purple_debug_is_verbose() && purple_debug_is_unsafe())
 {
                         purple_debug_warning("http",
                                 "Invalid URL provided: %s\n",
                                 raw_url);
                 }
                 return NULL;
         }
 }}}

 If regex_match fails for whatever reason then I think we are returning
 NULL without calling g_free on url.

-- 
Ticket URL: <https://developer.pidgin.im/ticket/16124>
Pidgin <https://pidgin.im>
Pidgin


More information about the Tracker mailing list