]> git.proxmox.com Git - mirror_ovs.git/commit - ofproto/ofproto-dpif-ipfix.c
ofproto-dpif-ipfix: Fix inefficent memory use in ipfix_send_template_msgs().
authorBen Pfaff <blp@ovn.org>
Sat, 27 May 2017 04:14:21 +0000 (21:14 -0700)
committerBen Pfaff <blp@ovn.org>
Wed, 5 Jul 2017 22:55:31 +0000 (15:55 -0700)
commit642c824b36be9bdde1b3370a97221ae3ca5b4e5f
treeb98e9f213a5d0e9393ceaec7b4fceec43727795b
parent56247a6022ebfa5e55d251f0c43f94a4cb7b0e5b
ofproto-dpif-ipfix: Fix inefficent memory use in ipfix_send_template_msgs().

This fixes inefficient use of memory in ipfix_send_template_msgs().
This function was setting up a buffer with a stub, but only the first 4
or 8 bytes of the stub were actually used because the "sizeof" call used
to size it was actually getting the size of a pointer.  This meant that
every template message was causing a series of allocations and
reallocations.

This commit fixes the problem.

Found by Coverity.

Reported-at: https://scan3.coverity.com/reports.htm#v16889/p10449/fileInstanceId=14762995&defectInstanceId=4304799&mergedDefectId=180398
Signed-off-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Justin Pettit <jpettit@ovn.org>
ofproto/ofproto-dpif-ipfix.c