Squash leaks

svn path=/trunk/netsurf/; revision=9692
This commit is contained in:
John Mark Bell 2009-11-22 14:10:39 +00:00
parent fb0198094b
commit a042e38548

View File

@ -234,20 +234,21 @@ void history_add(struct history *history, struct content *content,
/* allocate space */
entry = malloc(sizeof *entry);
if (entry == NULL)
return;
res = url_normalize(content->url, &url);
if (res != URL_FUNC_OK) {
warn_user("NoMemory", 0);
free(entry);
return;
}
title = strdup(content->title ? content->title : url);
if (!entry || !url || !title) {
if (title == NULL) {
warn_user("NoMemory", 0);
free(entry);
free(url);
free(title);
free(entry);
return;
}