[asterisk-commits] kharwell: branch kharwell/pimp_my_sip r385387 - /team/kharwell/pimp_my_sip/ch...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 11 17:31:55 CDT 2013
Author: kharwell
Date: Thu Apr 11 17:31:54 2013
New Revision: 385387
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385387
Log:
free to ast_free, inc/dec ref count for session object when sendtext_data references it
Modified:
team/kharwell/pimp_my_sip/channels/chan_gulp.c
Modified: team/kharwell/pimp_my_sip/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_my_sip/channels/chan_gulp.c?view=diff&rev=385387&r1=385386&r2=385387
==============================================================================
--- team/kharwell/pimp_my_sip/channels/chan_gulp.c (original)
+++ team/kharwell/pimp_my_sip/channels/chan_gulp.c Thu Apr 11 17:31:54 2013
@@ -1093,10 +1093,8 @@
static void sendtext_data_destroy(void *obj)
{
struct sendtext_data *data = obj;
-
- if (data->text) {
- free((char*)data->text);
- }
+ ast_free((char *)data->text);
+ ao2_ref(data->session, -1);
}
static struct sendtext_data* sendtext_data_create(struct ast_sip_session *session, const char *text)
@@ -1105,6 +1103,7 @@
if (data) {
data->session = session;
+ ao2_ref(data->session, +1);
data->text = ast_strdup(text);
}
return data;
More information about the asterisk-commits
mailing list