diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2005-04-09 22:56:34 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2005-04-09 22:56:34 +0000 |
commit | 63c33349f01933f7afb8e60e09e2fd533cf955c0 (patch) | |
tree | 00b02a261730d288c83bc09e31eb4986107bff99 /render | |
parent | 2ef1e63d3dd8d0591b13aa482d052149b97f2ffb (diff) | |
download | netsurf-63c33349f01933f7afb8e60e09e2fd533cf955c0.tar.gz netsurf-63c33349f01933f7afb8e60e09e2fd533cf955c0.tar.bz2 |
[project @ 2005-04-09 22:56:34 by jmb]
Fix inappropriate free()s of talloced content
svn path=/import/netsurf/; revision=1619
Diffstat (limited to 'render')
-rw-r--r-- | render/box_construct.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/render/box_construct.c b/render/box_construct.c index 9e2bc7bf6..5773fe7c7 100644 --- a/render/box_construct.c +++ b/render/box_construct.c @@ -102,7 +102,7 @@ static bool box_frameset(BOX_SPECIAL_PARAMS); static bool box_select_add_option(struct form_control *control, xmlNode *n); static bool box_object(BOX_SPECIAL_PARAMS); static bool box_embed(BOX_SPECIAL_PARAMS); -static bool box_applet(BOX_SPECIAL_PARAMS); +/*static bool box_applet(BOX_SPECIAL_PARAMS);*/ static bool box_iframe(BOX_SPECIAL_PARAMS); static bool plugin_decode(struct content* content, struct box* box); static struct box_multi_length *box_parse_multi_lengths(const char *s, @@ -1162,8 +1162,8 @@ bool box_object(BOX_SPECIAL_PARAMS) box->object_params = po; /* start fetch */ - if (plugin_decode(content, box)) - return false; + if (!plugin_decode(content, box)) + *convert_children = true; return true; } @@ -2207,12 +2207,21 @@ bool plugin_decode(struct content *content, struct box *box) /* free pre-existing codebase */ if (po->codebase) - free(po->codebase); + talloc_free(po->codebase); + + po->codebase = talloc_strdup(content, codebase); + if (!po->codebase) { + free(codebase); + return false; + } - po->codebase = codebase; + /* no longer need this */ + free(codebase); /* Set basehref */ - po->basehref = strdup(content->data.html.base_url); + po->basehref = talloc_strdup(content, content->data.html.base_url); + if (!po->basehref) + return false; if (po->data == 0 && po->classid == 0) /* no data => ignore this object */ @@ -2242,8 +2251,14 @@ bool plugin_decode(struct content *content, struct box *box) return false; } if (po->codebase) - free(po->codebase); - po->codebase = codebase; + talloc_free(po->codebase); + po->codebase = talloc_strdup(content, + codebase); + free(codebase); + if (!po->codebase) { + free(url); + return false; + } } else { LOG(("ActiveX object")); |