mirror of
https://github.com/weechat/weechat.git
synced 2026-06-28 22:06:38 +02:00
api: fix memory leak in function string_split
This commit is contained in:
@@ -28,6 +28,7 @@ Bug fixes::
|
||||
* core: fix check of tags in lines (command /filter and hook_print)
|
||||
* core: fix clear of completion item in case of partial completion (issue #1162)
|
||||
* core: send signal "key_pressed" for mouse code only if the string is UTF-8 valid (issue #1220)
|
||||
* api: fix memory leak in function string_split
|
||||
* scripts: fix duplicated lines in output of script eval (python, perl, ruby, lua and guile)
|
||||
|
||||
[[v2.2]]
|
||||
|
||||
@@ -1752,8 +1752,13 @@ string_split_internal (const char *string, const char *separators, int keep_eol,
|
||||
return NULL;
|
||||
|
||||
string2 = string_strip (string, 1, (keep_eol == 2) ? 0 : 1, separators);
|
||||
if (!string2 || !string2[0])
|
||||
if (!string2)
|
||||
return NULL;
|
||||
if (!string2[0])
|
||||
{
|
||||
free (string2);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* calculate number of items */
|
||||
ptr = string2;
|
||||
|
||||
Reference in New Issue
Block a user