Wireshark-commits: [Wireshark-commits] master 1431283: pcapng: do not leak blocks
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=14312835c63a3e2ec9d311ed1ffee5285141f4f9
Submitter: Peter Wu (peter@xxxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
1431283 by Peter Wu (peter@xxxxxxxxxxxxx):
pcapng: do not leak blocks
pcapng_open and pcapng_read have 'wblock' allocated on the stack, so if
they return, they do not have to set wblock.block to NULL.
pcapng_read_block always sets wblock->block to NULL and may initialize
it for SHB, IDB, NRB and ISB. Be sure to release the memory for IDB and
ISB. It is better to have more wtap_block_free calls on a NULL value
than missing them as this would be a memleak (on the other hand, do not
release memory that is stored elsewhere such as SHB and NRB).
Ping-Bug: 12790
Change-Id: I081f841addb36f16e3671095a919d357f4bc16c5
Reviewed-on: https://code.wireshark.org/review/17362
Petri-Dish: Peter Wu <peter@xxxxxxxxxxxxx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
Reviewed-by: Peter Wu <peter@xxxxxxxxxxxxx>
Actions performed:
from 22ba931 MAUSB: Add Status value defined in v1.0a Spec
adds 1431283 pcapng: do not leak blocks
Summary of changes:
wiretap/pcapng.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)