Change in osmo-ccid-firmware[master]: ccid_device: Fix memory leaks in ccid_handle_out() error paths

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 Nov 13 16:27:14 UTC 2019


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/16035 )

Change subject: ccid_device: Fix memory leaks in ccid_handle_out() error paths
......................................................................

ccid_device: Fix memory leaks in ccid_handle_out() error paths

Change-Id: I7c5e916992a7b55ca1ab006759c1f5c62b759d57
---
M ccid_common/ccid_device.c
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Hoernchen: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/ccid_common/ccid_device.c b/ccid_common/ccid_device.c
index 049b1cf..8183b16 100644
--- a/ccid_common/ccid_device.c
+++ b/ccid_common/ccid_device.c
@@ -644,6 +644,7 @@
 
 	if (len < sizeof(*ch)) {
 		/* FIXME */
+		msgb_free(msg);
 		return -1;
 	}
 
@@ -652,6 +653,7 @@
 	if (!cs) {
 		LOGPCI(ci, LOGL_ERROR, "Invalid bSlot %u\n", ch->bSlot);
 		resp = gen_err_resp(ch->bMessageType, ch->bSlot, CCID_ICC_STATUS_NO_ICC, ch->bSeq, 5);
+		msgb_free(msg);
 		return ccid_send(ci, resp);
 	}
 
@@ -661,6 +663,7 @@
 		/* FIXME: ABORT logic as per section 5.3.1 of CCID Spec v1.1 */
 		resp = gen_err_resp(ch->bMessageType, ch->bSlot, get_icc_status(cs), ch->bSeq,
 					CCID_ERR_CMD_SLOT_BUSY);
+		msgb_free(msg);
 		return ccid_send(ci, resp);
 	}
 

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: I7c5e916992a7b55ca1ab006759c1f5c62b759d57
Gerrit-Change-Number: 16035
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
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/20191113/9ecdffb3/attachment.htm>


More information about the gerrit-log mailing list