diff --git a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c index 9af20568e3..b0cb19f4c3 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nta/nta.c +++ b/libs/sofia-sip/libsofia-sip-ua/nta/nta.c @@ -3920,6 +3920,18 @@ char const *nta_leg_get_rtag(nta_leg_t const *leg) return NULL; } +/** Get local request sequence number. */ +uint32_t nta_leg_get_seq(nta_leg_t const *leg) +{ + return leg ? leg->leg_seq : 0; +} + +/** Get remote request sequence number. */ +uint32_t nta_leg_get_rseq(nta_leg_t const *leg) +{ + return leg ? leg->leg_rseq : 0; +} + /** Save target and route set at UAC side. * * @sa nta_leg_server_route(), @RFC3261 section 12.1.2 diff --git a/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h b/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h index 2d34688774..f7385759f2 100644 --- a/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h +++ b/libs/sofia-sip/libsofia-sip-ua/nta/sofia-sip/nta.h @@ -210,6 +210,12 @@ SOFIAPUBFUN char const *nta_leg_rtag(nta_leg_t *leg, char const *tag); /** Get remote tag. */ SOFIAPUBFUN char const *nta_leg_get_rtag(nta_leg_t const *leg); +/** Get local request sequence number. @NEW_1_12_9 */ +SOFIAPUBFUN uint32_t nta_leg_get_seq(nta_leg_t const *leg); + +/** Get remote request sequence number. @NEW_1_12_9 */ +SOFIAPUBFUN uint32_t nta_leg_get_rseq(nta_leg_t const *leg); + /** Set UAC route. */ SOFIAPUBFUN int nta_leg_client_route(nta_leg_t *leg, sip_record_route_t const *route, diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c b/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c index d150f563e3..cbca943bb7 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c @@ -780,7 +780,9 @@ void *su_alloc(su_home_t *home, isize_t size) */ void su_free(su_home_t *home, void *data) { - if (data) { + if (!data) + return; + if (home) { su_alloc_t *allocation; su_block_t *sub = MEMLOCK(home); diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_root.c b/libs/sofia-sip/libsofia-sip-ua/su/su_root.c index 42fd813428..b17ef400e0 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_root.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_root.c @@ -1046,10 +1046,13 @@ void su_msg_save(su_msg_r save, su_msg_r rmsg) */ void su_msg_destroy(su_msg_r rmsg) { - su_msg_t *msg = rmsg[0]; + su_msg_t *msg; + assert(rmsg); rmsg[0] = NULL; + msg = rmsg[0], rmsg[0] = NULL; + if (msg) { SU_TASK_ZAP(msg->sum_to, su_msg_destroy); SU_TASK_ZAP(msg->sum_from, su_msg_destroy);