mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 22:41:30 +03:00
Squash leaks
svn path=/trunk/netsurf/; revision=9692
This commit is contained in:
parent
fb0198094b
commit
a042e38548
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user