Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] register_tap_listener memleak

From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
Date: Fri, 16 Mar 2018 18:45:57 +0100
W dniu 2018-03-15 13:24, Peter Wu napisał(a):
> I was looking at memleaks as reported by LSAN while running the
> decryption test suite, there are quite a number of occurrences.

Can register_tap_listener() return enum code (one of: success, not found,
wrong filter)?
You will get rid of memleak, and users will get nicely translated message
error.

That sounds like a great idea at first, but it seems not viable given
that the error messages are:

- "Tap <tapname parameter> not found"

<tapname parameter> is passed by caller, so caller should be able to show it in message error.

- "Filter "<fstring parameter>" is invalid - <dfilter_compile error>"

Ah, I only did notice <fstring parameter> which is also passed by caller,
didn't notice dfilter_compile_error thing :(

Would it be to big change to pass compiled dfilter to register_tap_listener()?