summaryrefslogtreecommitdiff
path: root/riscos/window.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-09-07 11:12:49 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2014-09-07 11:12:49 +0100
commit31526e9bc66f915a864edf7c3bcd9e2ad14175b8 (patch)
treeaa1b5faf6a98f7e65311b7842a38371cd1b8ac2d /riscos/window.c
parent253475f304460803f2ddf3ad2cdca3d82b4683ad (diff)
downloadnetsurf-31526e9bc66f915a864edf7c3bcd9e2ad14175b8.tar.gz
netsurf-31526e9bc66f915a864edf7c3bcd9e2ad14175b8.tar.bz2
Remove pointless strdup/free.
Diffstat (limited to 'riscos/window.c')
-rw-r--r--riscos/window.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/riscos/window.c b/riscos/window.c
index 283730975..1b9ed3330 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -3961,32 +3961,23 @@ void ro_gui_window_prepare_objectinfo(hlcache_handle *object, const char *href)
void ro_gui_window_launch_url(struct gui_window *g, const char *url1)
{
- char *url2; /** @todo The risc os maintainer needs to examine why the url is copied here */
-
- ro_gui_url_complete_close();
-
- url2 = strdup(url1);
- if (url2 != NULL) {
- nserror error;
- nsurl *url;
+ nserror error;
+ nsurl *url;
- gui_window_set_url(g, url2);
+ if (url1 == NULL)
+ return;
- error = nsurl_create(url2, &url);
- if (error != NSERROR_OK) {
- warn_user(messages_get_errorcode(error), 0);
- } else {
- browser_window_navigate(g->bw,
- url,
- NULL,
- BW_NAVIGATE_HISTORY,
- NULL,
- NULL,
- NULL);
- nsurl_unref(url);
- }
+ ro_gui_url_complete_close();
+ gui_window_set_url(g, url1);
- free(url2);
+ error = nsurl_create(url1, &url);
+ if (error != NSERROR_OK) {
+ warn_user(messages_get_errorcode(error), 0);
+ } else {
+ browser_window_navigate(g->bw, url,
+ NULL, BW_NAVIGATE_HISTORY,
+ NULL, NULL, NULL);
+ nsurl_unref(url);
}
}