From 6b2c6b32747cf2cb35d3deca7b91a6d8d2b0c226 Mon Sep 17 00:00:00 2001 From: yashwardhan-jyani <100014271+yashwardhan-jyani@users.noreply.github.com> Date: Sat, 25 Mar 2023 09:39:13 +0530 Subject: [PATCH] Remove unneccessary NULL check in srs_freep. v5.0.150, v6.0.38 (#3477) PICK b574ad1a071ebd5044c69b438ddb8b0b7053978a Co-authored-by: winlin Co-authored-by: john --- trunk/doc/CHANGELOG.md | 1 + trunk/src/core/srs_core.hpp | 12 ++++-------- trunk/src/core/srs_core_version5.hpp | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index d010afd4f..ea7c45223 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 5.0 Changelog +* v5.0, 2023-03-25, Merge [#3477](https://github.com/ossrs/srs/pull/3477): Remove unneccessary NULL check in srs_freep. v5.0.150 (#3477) * v5.0, 2023-03-25, Merge [#3455](https://github.com/ossrs/srs/pull/3455): RTC: Call on_play before create session, for it might be freed for timeout. v5.0.149 (#3455) * v5.0, 2023-03-22, Merge [#3427](https://github.com/ossrs/srs/pull/3427): WHIP: Support DELETE resource for Larix Broadcaster. v5.0.148 (#3427) * v5.0, 2023-03-20, Merge [#3460](https://github.com/ossrs/srs/pull/3460): WebRTC: Support WHIP/WHEP players. v5.0.147 (#3460) diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 5bb332d5c..9aaa0ded8 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -44,17 +44,13 @@ // To free the p and set to NULL. // @remark The p must be a pointer T*. #define srs_freep(p) \ - if (p) { \ - delete p; \ - p = NULL; \ - } \ + delete p; \ + p = NULL; \ (void)0 // Please use the freepa(T[]) to free an array, otherwise the behavior is undefined. #define srs_freepa(pa) \ - if (pa) { \ - delete[] pa; \ - pa = NULL; \ - } \ + delete[] pa; \ + pa = NULL; \ (void)0 // Check CPU for ST(state-threads), please read https://github.com/ossrs/state-threads/issues/22 diff --git a/trunk/src/core/srs_core_version5.hpp b/trunk/src/core/srs_core_version5.hpp index 08eb4da33..213fce72c 100644 --- a/trunk/src/core/srs_core_version5.hpp +++ b/trunk/src/core/srs_core_version5.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 5 #define VERSION_MINOR 0 -#define VERSION_REVISION 148 +#define VERSION_REVISION 150 #endif