ipfix-export: Fix frame leak in flow_report_process_send() 86/36686/2
authorJon Loeliger <jdl@netgate.com>
Thu, 2 Jun 2022 20:18:54 +0000 (15:18 -0500)
committerAndrew Yourtchenko <ayourtch@gmail.com>
Sun, 14 Aug 2022 21:42:44 +0000 (21:42 +0000)
commit9dac6f9675a441de3c85ba7e86205866c6a979ac
tree69dae9a2872ea2b380c7f8b83456dcecc4788bfc
parentfa27d4d4f1f3a32eba275f3fc4e06ff15c7a5690
ipfix-export: Fix frame leak in flow_report_process_send()

The flow_report_process_send() function always allocates a frame.
However, when no template_send is needed, template_bi is ~0.
When this happens, no vectors are placed in the frame.  When
the frame is then "put", a check for n_vectors == 0 prevents
the frame from actually being placed back on the free list.
Fix that by using a direct call to vlib_frame_free() when
there are no frame vctors.

Type: fix
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Change-Id: I936b5cea4cb3c358247c3d2e1a77d034a322ea76
(cherry picked from commit eaa83c0439c13b76525224267c23d0cf52a6668b)
src/vnet/ipfix-export/flow_report.c