1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 03:03:12 +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
+6 -4
View File
@@ -31,7 +31,7 @@
* Returns spell info "spell_dict".
*/
const char *
char *
spell_info_info_spell_dict_cb (const void *pointer, void *data,
const char *info_name,
const char *arguments)
@@ -39,13 +39,15 @@ spell_info_info_spell_dict_cb (const void *pointer, void *data,
int rc;
unsigned long value;
struct t_gui_buffer *buffer;
const char *buffer_full_name;
const char *buffer_full_name, *ptr_dict;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) info_name;
ptr_dict = NULL;
if (!arguments)
return NULL;
@@ -67,9 +69,9 @@ spell_info_info_spell_dict_cb (const void *pointer, void *data,
buffer_full_name = arguments;
if (buffer_full_name)
return spell_get_dict_with_buffer_name (buffer_full_name);
ptr_dict = spell_get_dict_with_buffer_name (buffer_full_name);
return NULL;
return (ptr_dict) ? strdup (ptr_dict) : NULL;
}
/*