From b3c9278f848e11f4ad473c4dbd6e166ca5f7c36d Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 5 Jul 2023 08:28:45 -0400 Subject: [PATCH] MT#55283 fix double-free bug fixes #1688 Change-Id: If1a73381bae0d4f475237b65f0978c33e088cfb6 --- recording-daemon/stream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recording-daemon/stream.c b/recording-daemon/stream.c index e427395d1..388a9abd4 100644 --- a/recording-daemon/stream.c +++ b/recording-daemon/stream.c @@ -81,10 +81,13 @@ static void stream_handler(handler_t *handler) { packet_process(stream, buf, ret); // consumes buf else free(buf); + + buf = NULL; } pthread_mutex_unlock(&stream->lock); - free(buf); + if (buf) + free(buf); log_info_call = NULL; log_info_stream = NULL; }