Change in ...osmo-mgw[master]: mgcp_codec: split codec_free() off of codec_init()

neels gerrit-no-reply at lists.osmocom.org
Mon Aug 12 22:35:49 UTC 2019


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 <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at 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 <pespin at sysmocom.de>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190812/ad8b37e7/attachment.html>


More information about the gerrit-log mailing list