diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-04-02 21:04:00 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-04-02 21:04:00 +0100 |
commit | 979b59887f6e868908519640fc795db0070371f7 (patch) | |
tree | a3a544acb532edaa0f231a6ed88f80987c2c9687 /riscos/gui.c | |
parent | a9fb42e71bc55ad4b498beaf2202c09cc37c5056 (diff) | |
download | netsurf-979b59887f6e868908519640fc795db0070371f7.tar.gz netsurf-979b59887f6e868908519640fc795db0070371f7.tar.bz2 |
Fix leak of url found by cppcheck.
Diffstat (limited to 'riscos/gui.c')
-rw-r--r-- | riscos/gui.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/riscos/gui.c b/riscos/gui.c index 4f9856b83..05325c572 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -1594,6 +1594,7 @@ char *ro_gui_uri_file_parse(const char *file_name, char **uri_title) /* URI */ if (!ro_gui_uri_file_parse_line(fp, line)) goto uri_syntax_error; + url = strdup(line); if (!url) { warn_user("NoMemory", 0); @@ -1603,7 +1604,7 @@ char *ro_gui_uri_file_parse(const char *file_name, char **uri_title) /* title */ if (!ro_gui_uri_file_parse_line(fp, line)) - goto uri_syntax_error; + goto uri_free; if (uri_title && line[0] && ((line[0] != '*') || line[1])) { *uri_title = strdup(line); if (!*uri_title) /* non-fatal */ @@ -1613,6 +1614,9 @@ char *ro_gui_uri_file_parse(const char *file_name, char **uri_title) return url; +uri_free: + free(url); + uri_syntax_error: fclose(fp); warn_user("URIError", 0); |