diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-11-22 14:10:39 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-11-22 14:10:39 +0000 |
commit | a042e38548176930891aaa3b9f6c3ad927e2d824 (patch) | |
tree | bf2f26aaf58bc845d01560140f5a1bf5cd247ea0 | |
parent | fb0198094b865a4e355c6ec47275e25c2fde3379 (diff) | |
download | netsurf-a042e38548176930891aaa3b9f6c3ad927e2d824.tar.gz netsurf-a042e38548176930891aaa3b9f6c3ad927e2d824.tar.bz2 |
Squash leaks
svn path=/trunk/netsurf/; revision=9692
-rw-r--r-- | desktop/history_core.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; } |