From 0bb832d890dd910885919bbbeb83a806d9595b1e Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Fri, 5 Mar 2004 13:23:48 +0000 Subject: [PATCH] [project @ 2004-03-05 13:23:48 by jmb] Fix memory leak when fgets fails. Add debugging round early part of gui_init svn path=/import/netsurf/; revision=583 --- riscos/gui.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/riscos/gui.c b/riscos/gui.c index 0a816cee7..28e617eb2 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -132,16 +132,23 @@ void gui_init(int argc, char** argv) char theme_fname[256]; os_error *error; + LOG(("starting hourglass")); xhourglass_start(1); + LOG(("reading choices")); options_read("Choices:WWW.NetSurf.Choices"); + LOG(("choosing language")); ro_gui_choose_language(); + LOG(("grabbing NetSurf$Dir from the environment")); NETSURF_DIR = getenv("NetSurf$Dir"); sprintf(path, ".Resources.%s.Messages", option_language); + LOG(("Loading messages from '%s'", path)); messages_load(path); + LOG(("done")); + task_handle = wimp_initialise(wimp_VERSION_RO38, "NetSurf", (wimp_message_list*) &task_messages, 0); @@ -829,7 +836,10 @@ void ro_msg_dataload(wimp_message *message) fclose(fp); - if (!temp) return; + if (!temp) { + xfree(url); + return; + } if (url[strlen(url)-1] == '\n') { url[strlen(url)-1] = '\0'; @@ -949,7 +959,10 @@ void ro_msg_dataopen(wimp_message *message) fclose(fp); - if (!temp) return; + if (!temp) { + xfree(url); + return; + } if (url[strlen(url)-1] == '\n') { url[strlen(url)-1] = '\0';