From: Lubos Stanek Date: Sat, 4 Nov 2006 12:14:11 +0000 (+0100) Subject: ntpd plugin: Fix buffer reallocation when the message is send in more than one packet. X-Git-Tag: collectd-3.10.3~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=98a4d6de37cfad2e150ee95f22eb79e1b4cd740a;p=collectd.git ntpd plugin: Fix buffer reallocation when the message is send in more than one packet. --- diff --git a/src/ntpd.c b/src/ntpd.c index d65d1ed9..52042709 100644 --- a/src/ntpd.c +++ b/src/ntpd.c @@ -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;