1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 13:26:38 +02:00

api: return allocated string in hook_info callback and function info_get

This commit is contained in:
Sébastien Helleu
2019-04-12 21:29:39 +02:00
parent c80dc2a5ca
commit 3d95217745
54 changed files with 724 additions and 526 deletions
+4 -1
View File
@@ -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;