Author: jmb
Date: Sun Nov 22 08:10:39 2009
New Revision: 9692
URL:
http://source.netsurf-browser.org?rev=9692&view=rev
Log:
Squash leaks
Modified:
trunk/netsurf/desktop/history_core.c
Modified: trunk/netsurf/desktop/history_core.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/desktop/history_core.c?re...
==============================================================================
--- trunk/netsurf/desktop/history_core.c (original)
+++ trunk/netsurf/desktop/history_core.c Sun Nov 22 08:10:39 2009
@@ -234,20 +234,21 @@
/* 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(url);
free(entry);
- free(url);
- free(title);
return;
}