From 35cab857b6b87782be4549c767cb9013128a74e5 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sun, 19 Jul 2020 18:35:44 +0200 Subject: [PATCH] vss: Fix NULL pointer dereference in vss_del_fec_client(). fc->src_data may well be NULL here, for example if para_server is not currently playing. This bug was introduced in the previous commit after the topic branch had been promoted to next. --- vss.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vss.c b/vss.c index 737b77ac..9857d92d 100644 --- a/vss.c +++ b/vss.c @@ -689,9 +689,11 @@ void vss_del_fec_client(struct fec_client *fc) list_del(&fc->node); free(fc->enc_buf); - for (i = 0; i < fc_num_data_slices(fc); i++) - free(fc->src_data[i]); - free(fc->src_data); + if (fc->src_data) { + for (i = 0; i < fc_num_data_slices(fc); i++) + free(fc->src_data[i]); + free(fc->src_data); + } fec_free(fc->parms); free(fc); } -- 2.39.5