From 36e68e3e33f72c328da8097a6c55662e6068b221 Mon Sep 17 00:00:00 2001 From: Justin Shannon Date: Sun, 29 Nov 2020 09:25:03 -0800 Subject: [PATCH] Fix memory leak in jitter_buffer_put if packet arrives *very* late --- libspeexdsp/jitter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libspeexdsp/jitter.c b/libspeexdsp/jitter.c index a9c0dd3..b72b551 100644 --- a/libspeexdsp/jitter.c +++ b/libspeexdsp/jitter.c @@ -455,8 +455,11 @@ EXPORT void jitter_buffer_put(JitterBuffer *jitter, const JitterBufferPacket *pa else jitter->arrival[i] = jitter->next_stop; } - - + else + { + if (jitter->destroy) + jitter->destroy(packet->data); + } } /** Get one packet from the jitter buffer */