aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/nat/bsc_nat.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-05-15 00:29:50 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-06-15 20:24:19 +0800
commit1498d2e182ea6644a9965f47a327900d7b43ddbd (patch)
treea3ae909df898c87b53ea93bad88cf848a4fc943e /openbsc/src/nat/bsc_nat.c
parente635dab52fd8351cb3af2e120580374ae6a38065 (diff)
[nat] Separate exit2/exit3 as this can not be shared...
We have tried to send a refuse for arbitary things and ended up with a segfault... separate the exi2 and exit3 label to have separate exits and cleanups.
Diffstat (limited to 'openbsc/src/nat/bsc_nat.c')
-rw-r--r--openbsc/src/nat/bsc_nat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index daed23987..f21fe0240 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -670,6 +670,11 @@ exit:
goto exit2;
}
+exit2:
+ talloc_free(parsed);
+ msgb_free(msg);
+ return -1;
+
exit3:
/* send a SCCP Connection Refused */
refuse = sccp_create_refuse(parsed->src_local_ref, SCCP_REFUSAL_SCCP_FAILURE);
@@ -677,7 +682,7 @@ exit3:
bsc_send_data(bsc, refuse->l2h, msgb_l2len(refuse), IPAC_PROTO_SCCP);
msgb_free(refuse);
}
-exit2:
+
talloc_free(parsed);
msgb_free(msg);
return -1;