1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 02:03:13 +02:00

irc: fix memory leak in CTCP answer

This commit is contained in:
Sébastien Helleu
2014-08-09 19:54:39 +02:00
parent 4e43be6d2c
commit b78b5575c3
2 changed files with 16 additions and 9 deletions
+1
View File
@@ -128,6 +128,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* alias: change default command for alias /beep to "/print -beep"
* exec: add exec plugin: new command /exec and file exec.conf
* guile: fix module used after unload of a script
* irc: fix memory leak in CTCP answer
* irc: fix duplicate sender name in display of wallops (closes #142,
closes #145)
* irc: display locally away status changes in private buffers (in addition to
+15 -9
View File
@@ -417,17 +417,23 @@ irc_ctcp_replace_variables (struct t_irc_server *server, const char *format)
* Linux 2.6.32-5-amd64 / x86_64
*/
buf_uname = (struct utsname *)malloc (sizeof (struct utsname));
if (buf_uname && (uname (buf_uname) >= 0))
if (buf_uname)
{
snprintf (buf, sizeof (buf), "%s %s / %s",
buf_uname->sysname, buf_uname->release,
buf_uname->machine);
if (uname (buf_uname) >= 0)
{
snprintf (buf, sizeof (buf), "%s %s / %s",
buf_uname->sysname, buf_uname->release,
buf_uname->machine);
temp = weechat_string_replace (res, "$osinfo", buf);
free (res);
if (!temp)
{
free (buf_uname);
return NULL;
}
res = temp;
}
free (buf_uname);
temp = weechat_string_replace (res, "$osinfo", buf);
free (res);
if (!temp)
return NULL;
res = temp;
}
/*