1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 05:16: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
+8 -5
View File
@@ -1908,7 +1908,7 @@ IRC_PROTOCOL_CALLBACK(001)
IRC_PROTOCOL_CALLBACK(005)
{
char *pos, *pos2, *pos_start, *error;
char *pos, *pos2, *pos_start, *error, *isupport2;
int length_isupport, length, nick_max_length;
/*
@@ -1961,11 +1961,14 @@ IRC_PROTOCOL_CALLBACK(005)
if (server->isupport)
{
length_isupport = strlen (server->isupport);
server->isupport = realloc (server->isupport,
length_isupport + /* existing */
1 + length + 1); /* new */
if (server->isupport)
isupport2 = realloc (server->isupport,
length_isupport + /* existing */
1 + length + 1); /* new */
if (isupport2)
{
server->isupport = isupport2;
pos_start = server->isupport + length_isupport;
}
}
else
{