mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 01:33:12 +02:00
api: fix memory leak in function string_split
This commit is contained in:
@@ -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