summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-01-06 17:52:47 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-01-06 17:52:47 +0000
commitec868fdcdc7fefe7cb9dbb69380eb73d6742a383 (patch)
tree684018182f30495c587abc8573760e72c78d2cb6 /render
parent3d260f6e75da2ee2b1dd0b933e9f2552cf66f2d5 (diff)
downloadnetsurf-ec868fdcdc7fefe7cb9dbb69380eb73d6742a383.tar.gz
netsurf-ec868fdcdc7fefe7cb9dbb69380eb73d6742a383.tar.bz2
It's probably a good idea if we're consistent in which allocation routines we're using.
svn path=/trunk/netsurf/; revision=5972
Diffstat (limited to 'render')
-rw-r--r--render/html.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/render/html.c b/render/html.c
index cd02e21c3..047cd9114 100644
--- a/render/html.c
+++ b/render/html.c
@@ -197,8 +197,11 @@ encoding_change:
c->data.html.parser_binding,
&c->data.html.encoding_source);
- c->data.html.encoding = strdup(encoding);
- if (!c->data.html.encoding) {
+ if (c->data.html.encoding != NULL)
+ talloc_free(c->data.html.encoding);
+
+ c->data.html.encoding = talloc_strdup(c, encoding);
+ if (c->data.html.encoding == NULL) {
union content_msg_data msg_data;
msg_data.error = messages_get("NoMemory");
@@ -262,7 +265,7 @@ bool html_convert(struct content *c, int width, int height)
/* Also, any existing encoding information,
* as it's not guaranteed to match the error page.
*/
- free(c->data.html.encoding);
+ talloc_free(c->data.html.encoding);
c->data.html.encoding = NULL;
/* Create new binding, using default charset */