Change in osmo-mgw[master]: mgcp_client: allow to reset endpoints on startup

pespin gerrit-no-reply at lists.osmocom.org
Thu Jul 22 14:50:25 UTC 2021


pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/25008 )

Change subject: mgcp_client: allow to reset endpoints on startup
......................................................................


Patch Set 3: Code-Review-1

(3 comments)

https://gerrit.osmocom.org/c/osmo-mgw/+/25008/3/src/libosmo-mgcp-client/mgcp_client.c 
File src/libosmo-mgcp-client/mgcp_client.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/25008/3/src/libosmo-mgcp-client/mgcp_client.c@792 
PS3, Line 792: 		actual_reset_ep = talloc_memdup(ctx, reset_ep, sizeof(*reset_ep));
I bet talloc_memdup is not duplicating the char* name in reset_ep. So you end up having a new structure with a pointer pointing to the old one.
If the old one (config) is freed, then you keep a pointer to freed memory.


https://gerrit.osmocom.org/c/osmo-mgw/+/25008/3/src/libosmo-mgcp-client/mgcp_client.c@835 
PS3, Line 835: static const char *_mgcp_client_name_append_domain(const struct mgcp_client *mgcp, char *name)
const char *name


https://gerrit.osmocom.org/c/osmo-mgw/+/25008/3/src/libosmo-mgcp-client/mgcp_client.c@905 
PS3, Line 905: 		     _mgcp_client_name_append_domain(mgcp, reset_ep->name));
store it in a local pointer instead of calling the function twice for each iteration.



-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/25008
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I47e7ff858d5067b46d52329be5f362ff61c0dff8
Gerrit-Change-Number: 25008
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-Comment-Date: Thu, 22 Jul 2021 14:50:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210722/1f360ae9/attachment.htm>


More information about the gerrit-log mailing list