[MERGED] osmo-ggsn[master]: sgsnemu: Free strings in error path

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Nov 5 19:08:11 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: sgsnemu: Free strings in error path
......................................................................


sgsnemu: Free strings in error path

In create_pdp_conf(), we have to free() any strings both in the
success and in the error case.

Change-Id: If59cc8d6d151c123f46c1d029091209fd82b3c8e
Fixes: Coverity CID#187636, CID#187633
---
M sgsnemu/sgsnemu.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c
index 0b0fba6..c31f875 100644
--- a/sgsnemu/sgsnemu.c
+++ b/sgsnemu/sgsnemu.c
@@ -1459,9 +1459,9 @@
 					"router advertisements; SLAAC will not suceed, please "
 					"fix your setup!\n");
 			}
-			free(accept_ra);
-			free(forwarding);
 		}
+		free(accept_ra);
+		free(forwarding);
 	}
 
 	ipset((struct iphash_t *)pdp->peer, &addr);

-- 
To view, visit https://gerrit.osmocom.org/4689
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If59cc8d6d151c123f46c1d029091209fd82b3c8e
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list