mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
core: fix crash on plugin reload when using musl libs (closes #2052)
This commit is contained in:
@@ -1460,6 +1460,7 @@ void
|
||||
relay_config_free ()
|
||||
{
|
||||
weechat_config_free (relay_config_file);
|
||||
relay_config_file = NULL;
|
||||
|
||||
if (relay_config_regex_allowed_ips)
|
||||
{
|
||||
|
||||
@@ -162,6 +162,9 @@ relay_network_set_priority ()
|
||||
void
|
||||
relay_network_init ()
|
||||
{
|
||||
relay_network_init_ok = 0;
|
||||
relay_network_init_tls_cert_key_ok = 0;
|
||||
|
||||
/* credentials */
|
||||
gnutls_certificate_allocate_credentials (&relay_gnutls_x509_cred);
|
||||
relay_network_set_tls_cert_key (0);
|
||||
|
||||
@@ -203,6 +203,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
|
||||
weechat_plugin = plugin;
|
||||
|
||||
relay_signal_upgrade_received = 0;
|
||||
|
||||
if (!relay_config_init ())
|
||||
return WEECHAT_RC_ERROR;
|
||||
|
||||
@@ -240,7 +242,10 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
|
||||
(void) plugin;
|
||||
|
||||
if (relay_hook_timer)
|
||||
{
|
||||
weechat_unhook (relay_hook_timer);
|
||||
relay_hook_timer = NULL;
|
||||
}
|
||||
|
||||
relay_config_write ();
|
||||
|
||||
@@ -254,7 +259,11 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
|
||||
relay_server_free_all ();
|
||||
|
||||
if (relay_buffer)
|
||||
{
|
||||
weechat_buffer_close (relay_buffer);
|
||||
relay_buffer = NULL;
|
||||
}
|
||||
relay_buffer_selected_line = 0;
|
||||
|
||||
relay_client_free_all ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user