mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-24 22:46:15 +01:00
GSocket.receive_message: fix bogus allocation math
This commit is contained in:
parent
409cdb8d13
commit
78e8b39b49
@ -3038,9 +3038,8 @@ g_socket_receive_message (GSocket *socket,
|
|||||||
if (index == allocated)
|
if (index == allocated)
|
||||||
{
|
{
|
||||||
/* estimated 99% case: exactly 1 control message */
|
/* estimated 99% case: exactly 1 control message */
|
||||||
allocated = MIN (allocated * 2, 1);
|
allocated = MAX (allocated * 2, 1);
|
||||||
my_messages = g_new (GSocketControlMessage *, (allocated + 1));
|
my_messages = g_new (GSocketControlMessage *, (allocated + 1));
|
||||||
allocated = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
my_messages[index++] = message;
|
my_messages[index++] = message;
|
||||||
|
Loading…
Reference in New Issue
Block a user