aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-06-01 11:52:41 +0200
committerHarald Welte <laforge@gnumonks.org>2010-06-01 11:52:41 +0200
commit1371f7dd2fca97012869f5cce4867d0133d375da (patch)
treeb1a356de35040aafd39686f343c6587b18f4da27
parentf7b3a219f61ccf9fdbdea9acf2f2aa9c833d9838 (diff)
[GPRS] SGSN GTP: Fix segfault in case GGSN is down
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index df392b92f..7df932594 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -238,7 +238,7 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
/* Check for cause value if it was really successful */
if (cause < 0) {
LOGP(DGPRS, LOGL_NOTICE, "Create PDP ctx req timed out\n");
- if (pdp->version == 1) {
+ if (pdp && pdp->version == 1) {
pdp->version = 0;
gtp_create_context_req(sgsn->gsn, pdp, cbp);
return 0;
@@ -260,7 +260,8 @@ static int create_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
reject:
pctx->state = PDP_STATE_NONE;
- pdp_freepdp(pdp);
+ if (pdp)
+ pdp_freepdp(pdp);
sgsn_pdp_ctx_free(pctx);
/* Send PDP CTX ACT REJ to MS */
return gsm48_tx_gsm_act_pdp_rej(pctx->mm, pdp->ti, reject_cause,