Code

ntpd plugin: Fix buffer reallocation when the message is send in more than one packet.
authorLubos Stanek <lubek@users.sourceforge.net>
Sat, 4 Nov 2006 12:14:11 +0000 (13:14 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 4 Nov 2006 12:14:11 +0000 (13:14 +0100)
src/ntpd.c

index d65d1ed9e60c2e42c46bc6b404fe58559b162afa..520427095c27c300636167d13493d3845114afef 100644 (file)
@@ -694,6 +694,7 @@ static int ntpd_receive_response (int req_code, int *res_items, int *res_size,
                                (items_num + pkt_item_num) * res_item_size);
                items = realloc ((void *) *res_data,
                                (items_num + pkt_item_num) * res_item_size);
+               items_num += pkt_item_num;
                if (items == NULL)
                {
                        items = *res_data;