From 140ac99c0c9ff2e505d436ffe6733f9fca53f5ce Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 3 Jun 2020 13:21:39 +0200 Subject: Fix memleak again Memleak was reinroduced in d92c576aa53505d712715b1acc6344af3262c84f It was already fixed in ac5ce105ac08f022d88d7e73dc38f2706d4c44cf But the rebase peetahs rebase ontop of master took the wrong changes. I decided to pull anyways and fix since reviewing/giving feedback without GH probably takes longer. --- src/command/cmd_funcs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 59702fe3..7329046a 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -8921,10 +8921,14 @@ cmd_urlopen(ProfWin *window, const char *const command, gchar **args) return TRUE; } - gchar *argv[] = {prefs_get_string(PREF_URL_OPEN_CMD), args[0], NULL}; + gchar* cmd = prefs_get_string(PREF_URL_OPEN_CMD); + gchar *argv[] = {cmd, args[0], NULL}; + if (!call_external(argv, NULL, NULL)) { cons_show_error("Unable to open url: check the logs for more information."); } + + g_free(cmd); } else { cons_show("urlopen not supported in this window"); } -- cgit 1.4.1-2-gfad0