mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 14:26:39 +02:00
xfer: add check on filename2 allocation
Now string_expand_home() can return NULL if the HOME environment variable it not set, so this commit adds an extra check on the variable "filename2" before using it.
This commit is contained in:
@@ -1147,6 +1147,14 @@ xfer_add_cb (const void *pointer, void *data,
|
||||
free (path);
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
if (!filename2)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
_("%s%s: not enough memory (%s)"),
|
||||
weechat_prefix ("error"), XFER_PLUGIN_NAME,
|
||||
"xfer_add, filename2");
|
||||
goto error;
|
||||
}
|
||||
/* check if file exists */
|
||||
if (stat (filename2, &st) == -1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user