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: