1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 22:06:38 +02:00

core: fix bugs with calls to realloc

This commit is contained in:
Sebastien Helleu
2011-08-28 15:25:30 +02:00
parent e411d14b7a
commit f843f904bc
16 changed files with 259 additions and 106 deletions
+9 -2
View File
@@ -469,7 +469,7 @@ void
relay_client_irc_send_join (struct t_relay_client *client,
const char *channel)
{
char *infolist_name, *nicks;
char *infolist_name, *nicks, *nicks2;
const char *nick, *prefix, *topic;
char *host;
int length, length_nicks;
@@ -540,7 +540,14 @@ relay_client_irc_send_join (struct t_relay_client *client,
length_nicks += strlen (nick) + 1 + 1;
if (nicks)
{
nicks = realloc (nicks, length_nicks);
nicks2 = realloc (nicks, length_nicks);
if (!nicks2)
{
if (nicks)
free (nicks);
return;
}
nicks = nicks2;
strcat (nicks, " ");
}
else