Module: kamailio Branch: master Commit: f6dd56c8405189d0dcc16bd5d79927e919e8b572 URL: https://github.com/kamailio/kamailio/commit/f6dd56c8405189d0dcc16bd5d79927e9...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2023-01-10T13:12:06+01:00
rtp_media_server: safety check for shm allocation
---
Modified: src/modules/rtp_media_server/rms_sdp.c
---
Diff: https://github.com/kamailio/kamailio/commit/f6dd56c8405189d0dcc16bd5d79927e9... Patch: https://github.com/kamailio/kamailio/commit/f6dd56c8405189d0dcc16bd5d79927e9...
---
diff --git a/src/modules/rtp_media_server/rms_sdp.c b/src/modules/rtp_media_server/rms_sdp.c index c313d13646..b3330f58f0 100644 --- a/src/modules/rtp_media_server/rms_sdp.c +++ b/src/modules/rtp_media_server/rms_sdp.c @@ -251,6 +251,9 @@ PayloadType *rms_sdp_select_payload(rms_sdp_info_t *sdp) char *payloads = sdp->payloads.s; char *payload_type_number = strtok(payloads, " ");
+ if (!pt) { + return NULL; + } while (payload_type_number) { pt->type = atoi(payload_type_number); pt = rms_sdp_check_payload_type(pt, sdp); @@ -259,7 +262,7 @@ PayloadType *rms_sdp_select_payload(rms_sdp_info_t *sdp) } if (!pt->mime_type) { LM_INFO("unsuported codec\n"); - if (pt) shm_free(pt); // payload_type_destroy(pt); + shm_free(pt); // payload_type_destroy(pt); return NULL; } LM_INFO("payload_type:%d %s/%d/%d\n", pt->type, pt->mime_type,