neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/15132 )
Change subject: mgcp_codec: split codec_free() off of codec_init() ...................................................................... Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/15132/1/src/libosmo-mgcp/mgcp_codec.c File src/libosmo-mgcp/mgcp_codec.c: https://gerrit.osmocom.org/#/c/15132/1/src/libosmo-mgcp/mgcp_codec.c@117 PS1, Line 117: codec_init(codec); > So in here you are not longer freeing codec->subtype_name and > codec->audio_name. […] Yes: codec_set() is only used by codec_add(), and invariably it uses an *unpopulated* array entry. So there could be random data in that entry and we must not free those pointers. Instead it is important to free the memory when removing a codec entry, i.e. before it becomes an unpopulated array entry. For clarity this function should probably go inside codec_add()... yes I'll do that quickly. https://gerrit.osmocom.org/#/c/15132/1/src/libosmo-mgcp/mgcp_codec.c@239 PS1, Line 239: memset(codec, 0, sizeof(*codec)); > You can either drop this memset or line 96: "*codec = (struct > mgcp_rtp_codec){};" nice, thx -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15132 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I120cab0a352a1e7b31c8f9c720c47b2c291311d7 Gerrit-Change-Number: 15132 Gerrit-PatchSet: 1 Gerrit-Owner: neels <nhofm...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <lafo...@gnumonks.org> Gerrit-Reviewer: neels <nhofm...@sysmocom.de> Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-Comment-Date: Mon, 12 Aug 2019 22:35:49 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pes...@sysmocom.de> Gerrit-MessageType: comment