Bug 28144

Summary: Memory leak in error handling code for SOUP interface
Product: WebKit Reporter: John Kjellberg <john.kjellberg>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jmalonzo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: Linux   
Attachments:
Description Flags
Added "g_free" after calls to "soup_uri_to_string" and "g_file_get_uri" where they where missing. darin: review+

Description John Kjellberg 2009-08-10 06:06:08 PDT
When reviewing the code I believe I have found parts in the error handling code where "g_free" is missing. See attached patch for details.
Comment 1 John Kjellberg 2009-08-10 06:16:48 PDT
Created attachment 34449 [details]
Added "g_free" after calls to "soup_uri_to_string" and "g_file_get_uri" where they where missing.
Comment 2 John Kjellberg 2009-08-10 06:19:11 PDT
I'm sorry if I have misunderstood the code. I'm new to WebKit, SOUP and glib. Please give me some short input if I have missed something regarding the resource handling. Thanks.
Comment 3 Darin Adler 2009-08-10 10:19:24 PDT
Comment on attachment 34449 [details]
Added "g_free" after calls to "soup_uri_to_string" and "g_file_get_uri" where they where missing.

> +        char *uri=soup_uri_to_string(soup_message_get_uri(msg), false);

Formatting is wrong here. It should be "char* uri = soup…"

Otherwise, this patch looks great. I'm going to say r=me
Comment 4 Jan Alonzo 2009-08-10 11:26:52 PDT
(In reply to comment #3)
> (From update of attachment 34449 [details])
> > +        char *uri=soup_uri_to_string(soup_message_get_uri(msg), false);
> 
> Formatting is wrong here. It should be "char* uri = soup…"
> 
> Otherwise, this patch looks great. I'm going to say r=me

Thanks. Landed as http://trac.webkit.org/changeset/46989.