summaryrefslogtreecommitdiff
path: root/src/plugins/script/script-config.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-04-12 21:29:39 +0200
committerSébastien Helleu <flashcode@flashtux.org>2019-04-13 08:42:45 +0200
commit3d95217745cd269e6911a0830f7e6cc515828f07 (patch)
tree7cc372d8874c2d994c444199360c040778c3e153 /src/plugins/script/script-config.c
parentc80dc2a5ca93045ed7c358a8860532aab72f0c89 (diff)
downloadweechat-3d95217745cd269e6911a0830f7e6cc515828f07.zip
api: return allocated string in hook_info callback and function info_get
Diffstat (limited to 'src/plugins/script/script-config.c')
-rw-r--r--src/plugins/script/script-config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/script/script-config.c b/src/plugins/script/script-config.c
index 850255e8e..2006500f5 100644
--- a/src/plugins/script/script-config.c
+++ b/src/plugins/script/script-config.c
@@ -96,7 +96,8 @@ struct t_config_option *script_config_scripts_url;
const char *
script_config_get_diff_command ()
{
- const char *diff_command, *dir_separator;
+ const char *diff_command;
+ char *dir_separator;
static char result[64];
struct stat st;
char *path, **paths, bin[4096];
@@ -135,6 +136,8 @@ script_config_get_diff_command ()
weechat_string_free_split (paths);
}
}
+ if (dir_separator)
+ free (dir_separator);
if (!result[0])
snprintf (result, sizeof (result), "diff");
return result;