sunzhenguo / pacparser

Automatically exported from code.google.com/p/pacparser
GNU Lesser General Public License v3.0
0 stars 0 forks source link

memory leak in pacparser_find_proxy() #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In pacparser-1.3.0, the function pacparser_find_proxy() in pacparser.c does a 
malloc of a "script" string and never frees it.  JS_EvaluateScript() must not 
free its parameter because just above that point it is called with a string 
constant instead of a malloced string.

Based on the fact that pacparser_just_find_proxy() does (in effect) a strdup() 
of the return value of pacparser_find_proxy(), I am assuming that the return 
value of the latter is freed by pacparser_cleanup().  It would be good to 
document the fact that the caller of pacparser_just_find_proxy() is responsible 
for freeing its returned string.

Original issue reported on code.google.com by davedyks...@gmail.com on 26 Feb 2013 at 7:02

GoogleCodeExporter commented 9 years ago

Original comment by davedyks...@gmail.com on 26 Feb 2013 at 7:09

Attachments:

GoogleCodeExporter commented 9 years ago
Patch committed as part of Issue 23.

Original comment by manugarg on 15 Apr 2013 at 6:01