From: Terry Wilson Date: Fri, 15 Oct 2010 21:40:56 +0000 (+0000) Subject: Ref/unref res_srtp when we create/destroy a session X-Git-Tag: 1.8.0-rc4~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5b5faf3fc5ca3398e897de5438f79f13caf81197;p=thirdparty%2Fasterisk.git Ref/unref res_srtp when we create/destroy a session This avoids unhappy crashing when we try to 'core stop gracefully' and res_srtp tries to unload before chan_sip does. Thanks, Russell! (closes issue #18085) Reported by: st git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292016 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_srtp.c b/res/res_srtp.c index 76566d7de0..808444ca07 100644 --- a/res/res_srtp.c +++ b/res/res_srtp.c @@ -382,6 +382,7 @@ static int ast_srtp_create(struct ast_srtp **srtp, struct ast_rtp_instance *rtp, return -1; } + ast_module_ref(ast_module_info->self); temp->rtp = rtp; *srtp = temp; @@ -400,6 +401,7 @@ static void ast_srtp_destroy(struct ast_srtp *srtp) ao2_t_ref(srtp->policies, -1, "Destroying container"); ast_free(srtp); + ast_module_unref(ast_module_info->self); } static int ast_srtp_add_stream(struct ast_srtp *srtp, struct ast_srtp_policy *policy)