[Pidgin] #7051: In prox.c g_free() @line 260 could cause SEGFAULT - pdigin 2.5.1

Pidgin trac at pidgin.im
Thu Sep 11 11:57:13 EDT 2008


#7051: In prox.c   g_free() @line 260 could cause SEGFAULT - pdigin 2.5.1
----------------------------+-----------------------------------------------
Reporter:  oscar.getstring  |        Type:  defect        
  Status:  new              |   Component:  libpurple     
 Version:  2.5.1            |    Keywords:  proxy SEGFAULT
----------------------------+-----------------------------------------------
 Hello there,

 I am running the latest piding 2.5.1 compiled from sources
 and I use an http proxy.
 If I set in the account advance properties: Proxy type: Use  GNOME Proxy
 Settings when I try to connect I got a SEGFAULT.
 This happens with different accounts and it does not happen
 if I setup the proxy or I don't use a proxy.
 I traced the code and gdb pointed me to proxy.c line 269.
 At this  line there is a call to g_free(err);
 From the source it looks like there is either a g_free in the wrong place
 or some brackets missing around line 260.
 Line 260 is executed no matter the result of the if condition
 at line 257. Furthermore,  g_free is after a "return" so the function
 exits but the memory is not freed.
 I think you should enclose between brackets gfree and return.
 I actually modified the code as follow and I got rid of the SEGFAULT.

 {{{
         if (!g_spawn_command_line_sync("gconftool-2 -g
 /system/http_proxy/use_same_proxy",
                                        &tmp, &err, NULL, NULL)){
                 g_free(err);
                 return purple_global_proxy_get_info();
 }
 }}}
 You might want to check all you g_free there plus I suppose
 you can free as well the memory for tmp.

 Let me know if you need more info.

 Here other information about my environment:
 gnome 2.20.3
 glib-config --version 1.2.10
 gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)

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


More information about the Tracker mailing list