From ef336d552c71ba73b64acdcd6e65148c63edb858 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 26 Jul 2018 06:09:12 +1000 Subject: [PATCH] [parser/nal] no need to check for null before free (fixes #87) --- client/parsers/nal.c | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/client/parsers/nal.c b/client/parsers/nal.c index 942291dd..137326b6 100644 --- a/client/parsers/nal.c +++ b/client/parsers/nal.c @@ -68,27 +68,13 @@ bool nal_initialize(NAL * ptr) void nal_deinitialize(NAL this) { - if (this->slice_pred_weight_table_l1) - free(this->slice_pred_weight_table_l1); - - if (this->slice_pred_weight_table_l0) - free(this->slice_pred_weight_table_l0); - - if (this->pps_slice_group_id) - free(this->pps_slice_group_id); - - if (this->pps_slice_groups) - free(this->pps_slice_groups); - - if (this->sps_offset_for_ref_frame) - free(this->sps_offset_for_ref_frame); - - if (this->vui_nal_hrd_parameters_cpb) - free(this->vui_nal_hrd_parameters_cpb); - - if (this->vui_vcl_hrd_parameters_cpb) - free(this->vui_vcl_hrd_parameters_cpb); - + free(this->slice_pred_weight_table_l1); + free(this->slice_pred_weight_table_l0); + free(this->pps_slice_group_id); + free(this->pps_slice_groups); + free(this->sps_offset_for_ref_frame); + free(this->vui_nal_hrd_parameters_cpb); + free(this->vui_vcl_hrd_parameters_cpb); free(this); }