Module: kamailio
Branch: master
Commit: 408cad8cd67f1c3568fddb0f6b6fcc715ecec181
URL:
https://github.com/kamailio/kamailio/commit/408cad8cd67f1c3568fddb0f6b6fcc7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-01-10T13:13:11+01:00
rtp_media_server: reorder code for rms_payload_type_new() to update field after memset
---
Modified: src/modules/rtp_media_server/rms_sdp.c
---
Diff:
https://github.com/kamailio/kamailio/commit/408cad8cd67f1c3568fddb0f6b6fcc7…
Patch:
https://github.com/kamailio/kamailio/commit/408cad8cd67f1c3568fddb0f6b6fcc7…
---
diff --git a/src/modules/rtp_media_server/rms_sdp.c
b/src/modules/rtp_media_server/rms_sdp.c
index b3330f58f0..f263e2622f 100644
--- a/src/modules/rtp_media_server/rms_sdp.c
+++ b/src/modules/rtp_media_server/rms_sdp.c
@@ -187,8 +187,11 @@ PayloadType *
rms_payload_type_new() // This could be problematic as it must remain compatible with the
constructor in MS2.
{
PayloadType *newpayload = (PayloadType *)shm_malloc(sizeof(PayloadType));
- newpayload->flags |= PAYLOAD_TYPE_ALLOCATED;
+ if(!newpayload) {
+ return NULL;
+ }
memset(newpayload, 0, sizeof(PayloadType));
+ newpayload->flags |= PAYLOAD_TYPE_ALLOCATED;
return newpayload;
}