From a221fa721360e4aef1488eddc4891e10c26cb73d Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 29 Oct 2014 22:14:48 +0000 Subject: Ensure browser window creation returns errors from common initialisation. The browser window common initialisation code returns error codes which were being ignored. The errors were additionally being reported via warn_user in inappropriate places within browser history construction. --- desktop/browser_history.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'desktop/browser_history.c') diff --git a/desktop/browser_history.c b/desktop/browser_history.c index 445c0ee06..309bcb2b4 100644 --- a/desktop/browser_history.c +++ b/desktop/browser_history.c @@ -416,9 +416,9 @@ static bool browser_window_history__enumerate_entry( /** * Create a new history tree for a browser window window. * - * \param bw browser window to create history for. + * \param bw browser window to create history for. * - * \return NSERROR_OK or appropriate error otherwise + * \return NSERROR_OK or appropriate error otherwise */ nserror browser_window_history_create(struct browser_window *bw) @@ -428,10 +428,10 @@ nserror browser_window_history_create(struct browser_window *bw) bw->history = NULL; history = calloc(1, sizeof *history); - if (!history) { - warn_user("NoMemory", 0); + if (history == NULL) { return NSERROR_NOMEM; } + history->width = RIGHT_MARGIN / 2; history->height = BOTTOM_MARGIN / 2; @@ -473,7 +473,6 @@ nserror browser_window_history_clone(const struct browser_window *existing, new_history->start); if (!new_history->start) { LOG(("Insufficient memory to clone history")); - warn_user("NoMemory", 0); browser_window_history_destroy(clone); clone->history = NULL; return NSERROR_NOMEM; -- cgit v1.2.3