diff options
-rw-r--r-- | ggsn/ggsn.c | 2 | ||||
-rw-r--r-- | gtp/gtp.c | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 95371a2..d71855d 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -386,7 +386,7 @@ static int delete_context(struct pdp_t *pdp) LOGPPDP(LOGL_ERROR, pdp, "Cannot find/free IP Pool member\n"); } - if (apn->cfg.gtpu_mode == APN_GTPU_MODE_KERNEL_GTP) { + if (apn && apn->cfg.gtpu_mode == APN_GTPU_MODE_KERNEL_GTP) { if (gtp_kernel_tunnel_del(pdp, apn->tun.cfg.dev_name)) { LOGPPDP(LOGL_ERROR, pdp, "Cannot delete tunnel from kernel:%s\n", strerror(errno)); @@ -1301,9 +1301,8 @@ int gtp_create_context_resp(struct gsn_t *gsn, struct pdp_t *pdp, int cause) /* Now send off a reply to the peer */ gtp_create_pdp_resp(gsn, pdp->version, pdp, cause); - if (cause != GTPCAUSE_ACC_REQ) { - pdp_freepdp(pdp); - } + if (cause != GTPCAUSE_ACC_REQ) + gtp_freepdp(gsn, pdp); return 0; } |