X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3d9ae63197107f1edce8c117b49332306e3ed8fb..6da51b3ec9fc858728e5ea981757d05f970958e0:/print.c diff --git a/print.c b/print.c index 1669cb3b..21182ba2 100644 --- a/print.c +++ b/print.c @@ -405,6 +405,13 @@ pretty_print_packet(netdissect_options *ndo, const struct pcap_pkthdr *h, ND_PRINT(" [|%s]", ndo->ndo_protocol); } + /* + * Free all pushed buffers; if we got here by a printer quitting, + * we need to release anything that didn't get released because + * we longjmped out of the code before it popped a buffer. + */ + nd_pop_all_buffers(ndo); + /* * Restore the original snapend, as a printer might have * changed it.