summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/plugins-interface.c2
-rw-r--r--src/plugins/scripts/perl/weechat-perl.c19
-rw-r--r--src/plugins/scripts/python/weechat-python.c4
-rw-r--r--weechat/src/plugins/plugins-interface.c2
-rw-r--r--weechat/src/plugins/scripts/perl/weechat-perl.c19
-rw-r--r--weechat/src/plugins/scripts/python/weechat-python.c4
6 files changed, 34 insertions, 16 deletions
diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c
index d496557c3..439f1295c 100644
--- a/src/plugins/plugins-interface.c
+++ b/src/plugins/plugins-interface.c
@@ -995,6 +995,8 @@ weechat_plugin_free_server_info (t_weechat_plugin *plugin, t_plugin_server_info
free (server_info->notify_levels);
if (server_info->nick)
free (server_info->nick);
+ if (server_info->nick_modes)
+ free (server_info->nick_modes);
new_server_info = server_info->next_server;
free (server_info);
server_info = new_server_info;
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c
index 7c33c4e8b..ed0ad28e2 100644
--- a/src/plugins/scripts/perl/weechat-perl.c
+++ b/src/plugins/scripts/perl/weechat-perl.c
@@ -1459,7 +1459,7 @@ static XS (XS_weechat_get_server_info)
localtime(&ptr_server->away_time));
server_hash_member = (HV *) sv_2mortal((SV *) newHV());
-
+
hv_store (server_hash_member, "autoconnect", 11, newSViv (ptr_server->autoconnect), 0);
hv_store (server_hash_member, "autoreconnect", 13, newSViv (ptr_server->autoreconnect), 0);
hv_store (server_hash_member, "autoreconnect_delay", 19, newSViv (ptr_server->autoreconnect_delay), 0);
@@ -1485,12 +1485,14 @@ static XS (XS_weechat_get_server_info)
hv_store (server_hash_member, "nick_modes", 10, newSVpv (ptr_server->nick_modes, 0), 0);
hv_store (server_hash_member, "away_time", 9, newSVpv (timebuffer, 0), 0);
hv_store (server_hash_member, "lag", 3, newSViv (ptr_server->lag), 0);
-
+
hv_store (server_hash, ptr_server->name, strlen(ptr_server->name), newRV_inc((SV *) server_hash_member), 0);
- }
+ }
perl_plugin->free_server_info (perl_plugin, server_info);
ST (0) = newRV_inc((SV *) server_hash);
+ if (SvREFCNT(ST(0))) sv_2mortal(ST(0));
+
XSRETURN (1);
}
@@ -1557,6 +1559,8 @@ static XS (XS_weechat_get_channel_info)
perl_plugin->free_channel_info (perl_plugin, channel_info);
ST (0) = newRV_inc((SV *) channel_hash);
+ if (SvREFCNT(ST(0))) sv_2mortal(ST(0));
+
XSRETURN (1);
}
@@ -1621,6 +1625,8 @@ static XS (XS_weechat_get_nick_info)
perl_plugin->free_nick_info (perl_plugin, nick_info);
ST (0) = newRV_inc((SV *) nick_hash);
+ if (SvREFCNT(ST(0))) sv_2mortal(ST(0));
+
XSRETURN (1);
}
@@ -1790,7 +1796,7 @@ static XS (XS_weechat_get_buffer_info)
for (ptr_buffer = buffer_info; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
buffer_hash_member = (HV *) sv_2mortal((SV *) newHV());
-
+
hv_store (buffer_hash_member, "type", 4, newSViv (ptr_buffer->type), 0);
hv_store (buffer_hash_member, "num_displayed", 13, newSViv (ptr_buffer->num_displayed), 0);
hv_store (buffer_hash_member, "server", 6,
@@ -1800,13 +1806,14 @@ static XS (XS_weechat_get_buffer_info)
hv_store (buffer_hash_member, "notify_level", 12, newSViv (ptr_buffer->notify_level), 0);
hv_store (buffer_hash_member, "log_filename", 12,
newSVpv (ptr_buffer->log_filename == NULL ? "" : ptr_buffer->log_filename, 0), 0);
-
snprintf(conv, sizeof(conv), "%d", ptr_buffer->number);
- hv_store (buffer_hash, conv, strlen(conv), newRV_inc((SV *) buffer_hash_member), 0);
+ hv_store (buffer_hash, conv, strlen(conv), newRV_inc((SV *) buffer_hash_member), 0);
}
perl_plugin->free_buffer_info (perl_plugin, buffer_info);
ST (0) = newRV_inc((SV *) buffer_hash);
+ if (SvREFCNT(ST(0))) sv_2mortal(ST(0));
+
XSRETURN (1);
}
diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c
index 3506580e8..7a5d58e4d 100644
--- a/src/plugins/scripts/python/weechat-python.c
+++ b/src/plugins/scripts/python/weechat-python.c
@@ -1480,7 +1480,7 @@ weechat_python_get_server_info (PyObject *self, PyObject *args)
PyDict_SetItem(server_hash_member, key, value);
Py_DECREF (key);
Py_DECREF (value);
-
+
key = Py_BuildValue("s", "autoreconnect");
value = Py_BuildValue("i", ptr_server->autoreconnect);
PyDict_SetItem(server_hash_member, key, value);
@@ -1572,7 +1572,7 @@ weechat_python_get_server_info (PyObject *self, PyObject *args)
Py_DECREF (value);
key = Py_BuildValue("s", "autojoin");
- Py_BuildValue("s", ptr_server->autojoin);
+ value = Py_BuildValue("s", ptr_server->autojoin);
PyDict_SetItem(server_hash_member, key, value);
Py_DECREF (key);
Py_DECREF (value);
diff --git a/weechat/src/plugins/plugins-interface.c b/weechat/src/plugins/plugins-interface.c
index d496557c3..439f1295c 100644
--- a/weechat/src/plugins/plugins-interface.c
+++ b/weechat/src/plugins/plugins-interface.c
@@ -995,6 +995,8 @@ weechat_plugin_free_server_info (t_weechat_plugin *plugin, t_plugin_server_info
free (server_info->notify_levels);
if (server_info->nick)
free (server_info->nick);
+ if (server_info->nick_modes)
+ free (server_info->nick_modes);
new_server_info = server_info->next_server;
free (server_info);
server_info = new_server_info;
diff --git a/weechat/src/plugins/scripts/perl/weechat-perl.c b/weechat/src/plugins/scripts/perl/weechat-perl.c
index 7c33c4e8b..ed0ad28e2 100644
--- a/weechat/src/plugins/scripts/perl/weechat-perl.c
+++ b/weechat/src/plugins/scripts/perl/weechat-perl.c
@@ -1459,7 +1459,7 @@ static XS (XS_weechat_get_server_info)
localtime(&ptr_server->away_time));
server_hash_member = (HV *) sv_2mortal((SV *) newHV());
-
+
hv_store (server_hash_member, "autoconnect", 11, newSViv (ptr_server->autoconnect), 0);
hv_store (server_hash_member, "autoreconnect", 13, newSViv (ptr_server->autoreconnect), 0);
hv_store (server_hash_member, "autoreconnect_delay", 19, newSViv (ptr_server->autoreconnect_delay), 0);
@@ -1485,12 +1485,14 @@ static XS (XS_weechat_get_server_info)
hv_store (server_hash_member, "nick_modes", 10, newSVpv (ptr_server->nick_modes, 0), 0);
hv_store (server_hash_member, "away_time", 9, newSVpv (timebuffer, 0), 0);
hv_store (server_hash_member, "lag", 3, newSViv (ptr_server->lag), 0);
-
+
hv_store (server_hash, ptr_server->name, strlen(ptr_server->name), newRV_inc((SV *) server_hash_member), 0);
- }
+ }
perl_plugin->free_server_info (perl_plugin, server_info);
ST (0) = newRV_inc((SV *) server_hash);
+ if (SvREFCNT(ST(0))) sv_2mortal(ST(0));
+
XSRETURN (1);
}
@@ -1557,6 +1559,8 @@ static XS (XS_weechat_get_channel_info)
perl_plugin->free_channel_info (perl_plugin, channel_info);
ST (0) = newRV_inc((SV *) channel_hash);
+ if (SvREFCNT(ST(0))) sv_2mortal(ST(0));
+
XSRETURN (1);
}
@@ -1621,6 +1625,8 @@ static XS (XS_weechat_get_nick_info)
perl_plugin->free_nick_info (perl_plugin, nick_info);
ST (0) = newRV_inc((SV *) nick_hash);
+ if (SvREFCNT(ST(0))) sv_2mortal(ST(0));
+
XSRETURN (1);
}
@@ -1790,7 +1796,7 @@ static XS (XS_weechat_get_buffer_info)
for (ptr_buffer = buffer_info; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
buffer_hash_member = (HV *) sv_2mortal((SV *) newHV());
-
+
hv_store (buffer_hash_member, "type", 4, newSViv (ptr_buffer->type), 0);
hv_store (buffer_hash_member, "num_displayed", 13, newSViv (ptr_buffer->num_displayed), 0);
hv_store (buffer_hash_member, "server", 6,
@@ -1800,13 +1806,14 @@ static XS (XS_weechat_get_buffer_info)
hv_store (buffer_hash_member, "notify_level", 12, newSViv (ptr_buffer->notify_level), 0);
hv_store (buffer_hash_member, "log_filename", 12,
newSVpv (ptr_buffer->log_filename == NULL ? "" : ptr_buffer->log_filename, 0), 0);
-
snprintf(conv, sizeof(conv), "%d", ptr_buffer->number);
- hv_store (buffer_hash, conv, strlen(conv), newRV_inc((SV *) buffer_hash_member), 0);
+ hv_store (buffer_hash, conv, strlen(conv), newRV_inc((SV *) buffer_hash_member), 0);
}
perl_plugin->free_buffer_info (perl_plugin, buffer_info);
ST (0) = newRV_inc((SV *) buffer_hash);
+ if (SvREFCNT(ST(0))) sv_2mortal(ST(0));
+
XSRETURN (1);
}
diff --git a/weechat/src/plugins/scripts/python/weechat-python.c b/weechat/src/plugins/scripts/python/weechat-python.c
index 3506580e8..7a5d58e4d 100644
--- a/weechat/src/plugins/scripts/python/weechat-python.c
+++ b/weechat/src/plugins/scripts/python/weechat-python.c
@@ -1480,7 +1480,7 @@ weechat_python_get_server_info (PyObject *self, PyObject *args)
PyDict_SetItem(server_hash_member, key, value);
Py_DECREF (key);
Py_DECREF (value);
-
+
key = Py_BuildValue("s", "autoreconnect");
value = Py_BuildValue("i", ptr_server->autoreconnect);
PyDict_SetItem(server_hash_member, key, value);
@@ -1572,7 +1572,7 @@ weechat_python_get_server_info (PyObject *self, PyObject *args)
Py_DECREF (value);
key = Py_BuildValue("s", "autojoin");
- Py_BuildValue("s", ptr_server->autojoin);
+ value = Py_BuildValue("s", ptr_server->autojoin);
PyDict_SetItem(server_hash_member, key, value);
Py_DECREF (key);
Py_DECREF (value);