]> The Tcpdump Group git mirrors - libpcap/commit
Plug memory leaks from pcap_ether_hostton().
authorDenis Ovsienko <[email protected]>
Thu, 17 Apr 2025 20:12:20 +0000 (21:12 +0100)
committerDenis Ovsienko <[email protected]>
Mon, 21 Apr 2025 20:35:11 +0000 (21:35 +0100)
commitad56fa246d80deeca6f632726eedde395162eb7b
tree4860b8aac13c97b559c61811de89e10ef4879f58
parenta5090c63f88ade0525170f7bd4e0c941aaaf2f2e
Plug memory leaks from pcap_ether_hostton().

pcap_ether_hostton() returns a pointer to allocated memory, which needs
to be freed, which gen_scode() does for the successful case only.  To
have the memory freed in any case, copy the value into a local variable
and free the allocated memory immediately thereafter -- this suffices
since the data size is fixed and the value needs to be used only once
per code path.  In other words, apply the solution from commit 2b01095
to the problem from commit bcbef22.
gencode.c