From 34370a59849f5731aec77901e3fd1b446364c3c2 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Thu, 2 Sep 2010 17:33:51 +0000 Subject: [PATCH] Don't crash in __pri_new_tei() if a GR303 subchannel creation fails. git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1955 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- pri.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pri.c b/pri.c index 45865ad..e453b90 100644 --- a/pri.c +++ b/pri.c @@ -372,7 +372,7 @@ struct pri *__pri_new_tei(int fd, int node, int switchtype, struct pri *master, p->subchannel = __pri_new_tei(-1, node, PRI_SWITCH_GR303_EOC_PATH, p, NULL, NULL, NULL, Q921_TEI_GR303_EOC_PATH, 0); if (!p->subchannel) { free(p); - p = NULL; + return NULL; } break; case PRI_SWITCH_GR303_TMC: @@ -382,7 +382,7 @@ struct pri *__pri_new_tei(int fd, int node, int switchtype, struct pri *master, p->subchannel = __pri_new_tei(-1, node, PRI_SWITCH_GR303_TMC_SWITCHING, p, NULL, NULL, NULL, Q921_TEI_GR303_TMC_SWITCHING, 0); if (!p->subchannel) { free(p); - p = NULL; + return NULL; } break; case PRI_SWITCH_GR303_TMC_SWITCHING: