From a042e38548176930891aaa3b9f6c3ad927e2d824 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 22 Nov 2009 14:10:39 +0000 Subject: Squash leaks svn path=/trunk/netsurf/; revision=9692 --- desktop/history_core.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'desktop') diff --git a/desktop/history_core.c b/desktop/history_core.c index 4a30d1783..197a42327 100644 --- a/desktop/history_core.c +++ b/desktop/history_core.c @@ -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; } -- cgit v1.2.3