From 103e4fbf619f5d4a8289a641d86925710fb74308 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Thu, 25 Oct 2007 03:19:58 +0000 Subject: Added assertion which checks if evsub module has been registered before other calls pjsip_evsub_register_pkg() (thanks Alexander Agranovsky) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1522 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip-simple/evsub.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pjsip/src/pjsip-simple/evsub.c b/pjsip/src/pjsip-simple/evsub.c index b3ef031f..3b005b5e 100644 --- a/pjsip/src/pjsip-simple/evsub.c +++ b/pjsip/src/pjsip-simple/evsub.c @@ -405,6 +405,9 @@ PJ_DEF(pj_status_t) pjsip_evsub_register_pkg( pjsip_module *pkg_mod, PJ_ASSERT_RETURN(accept_cnt < PJ_ARRAY_SIZE(pkg->pkg_accept->values), PJ_ETOOMANY); + /* Make sure evsub module has been initialized */ + PJ_ASSERT_RETURN(mod_evsub.mod.id != -1, PJ_EINVALIDOP); + /* Make sure no module with the specified name already registered: */ PJ_ASSERT_RETURN(find_pkg(event_name) == NULL, PJSIP_SIMPLE_EPKGEXISTS); -- cgit v1.2.3