Change in osmo-mgw[master]: mgcp_client_pending_add(): Consider "talloc returns NULL" case

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Jul 15 09:21:25 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/19270 )

Change subject: mgcp_client_pending_add(): Consider "talloc returns NULL" case
......................................................................

mgcp_client_pending_add(): Consider "talloc returns NULL" case

Change-Id: I43a4715fa41fba5a5506fc08e3c21ef6f9ca2521
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index eeb5e4f..bbf805b 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -911,6 +911,9 @@
 	struct mgcp_response_pending *pending;
 
 	pending = talloc_zero(mgcp, struct mgcp_response_pending);
+	if (!pending)
+		return NULL;
+
 	pending->trans_id = trans_id;
 	pending->response_cb = response_cb;
 	pending->priv = priv;
@@ -943,6 +946,10 @@
 	}
 
 	pending = mgcp_client_pending_add(mgcp, trans_id, response_cb, priv);
+	if (!pending) {
+		talloc_free(msg);
+		return -ENOMEM;
+	}
 
 	if (msgb_l2len(msg) > 4096) {
 		LOGP(DLMGCP, LOGL_ERROR,

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

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I43a4715fa41fba5a5506fc08e3c21ef6f9ca2521
Gerrit-Change-Number: 19270
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200715/188955bf/attachment.htm>


More information about the gerrit-log mailing list