It's probably a good idea if we're consistent in which allocation routines we're using.

svn path=/trunk/netsurf/; revision=5972
This commit is contained in:
John Mark Bell 2009-01-06 17:52:47 +00:00
parent 3d260f6e75
commit ec868fdcdc
1 changed files with 6 additions and 3 deletions

View File

@ -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 */