mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-23 22:16:16 +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)
|
||||
{
|
||||
/* estimated 99% case: exactly 1 control message */
|
||||
allocated = MIN (allocated * 2, 1);
|
||||
allocated = MAX (allocated * 2, 1);
|
||||
my_messages = g_new (GSocketControlMessage *, (allocated + 1));
|
||||
allocated = 1;
|
||||
}
|
||||
|
||||
my_messages[index++] = message;
|
||||
|
Loading…
Reference in New Issue
Block a user