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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user