[Pidgin] #7047: memory leak and logic error in proxy.c in pidgin 2.5.1

Pidgin trac at pidgin.im
Thu Sep 11 03:33:53 EDT 2008


#7047: memory leak and logic error in proxy.c in pidgin 2.5.1
--------------------+-------------------------------------------------------
Reporter:  rfan.cn  |        Type:  patch       
  Status:  new      |   Component:  libpurple   
 Version:  2.5.1    |    Keywords:  proxy detect
--------------------+-------------------------------------------------------
 There two defects in function purple_gnome_proxy_get_info when comparing
 with pidgin 2.4.3:

 '''1. there exist some memory leak'''[[BR]]
 '''2. some logic error added in 2.5.1'''

 '''(1)Regards memory leak:'''

 line: 223
 {{{
 /* Check whether to use a proxy. */
 if (!g_spawn_command_line_sync("gconftool-2 -g /system/proxy/mode",
 &tmp, &err, NULL, NULL))
   return purple_global_proxy_get_info();
 }}}

 if it got some stderr output, err should be released, there many places
 like that in this function

 '''(2)Regards logic error:'''

 line: 257

 {{{
 if (!g_spawn_command_line_sync("gconftool-2 -g
 /system/http_proxy/use_same_proxy", &tmp, &err, NULL, NULL))
     return purple_global_proxy_get_info();
 }}}

 here no such "/system/http_proxy/use_same_proxy" entry in gnome global
 configuration, from my understanding, developer just want to check wether
 there set  "/system/http_proxy/use_http_proxy".
 * if no, if socks5 proxy host also be set, then can be decided socks5
 proxy want to be used.
 * if yes, then it can be decided the http proxy want to be used.

 Attachment is the fixed version of proxy.c

-- 
Ticket URL: <http://developer.pidgin.im/ticket/7047>
Pidgin <http://pidgin.im>
Pidgin


More information about the Tracker mailing list