]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
prevent seg in sofia dialog refresh on null dialog
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 18 Dec 2008 20:33:21 +0000 (20:33 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 18 Dec 2008 20:33:21 +0000 (20:33 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10873 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia_presence.c

index 8cd1fe0a5cc349890c5c1901207e056647b4b72e..8253b8c66fb7347a83ec6838115fa89232b7a2a1 100644 (file)
@@ -1210,7 +1210,9 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
                unsigned delta = (unsigned) (exptime * -1);
                switch_snprintf(sstr, sizeof(sstr), "active;expires=%u", delta);
                switch_snprintf(expires_str, sizeof(expires_str), "%u", delta);
-               nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, delta, delta);
+               if (nh && nh->nh_ds && nh->nh_ds->ds_usage) {
+                       nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, delta, delta);
+               }
        }
 
        nua_notify(nh, 
@@ -1661,9 +1663,9 @@ void sofia_presence_handle_sip_i_subscribe(int status,
                        }
 
                        
-
-                       nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, exp_delta + SUB_OVERLAP, exp_delta + SUB_OVERLAP);
-                       
+                       if (nh && nh->nh_ds && nh->nh_ds->ds_usage) {
+                               nua_dialog_usage_set_refresh_range(nh->nh_ds->ds_usage, exp_delta + SUB_OVERLAP, exp_delta + SUB_OVERLAP);
+                       }
 
                        nua_respond(nh, SIP_202_ACCEPTED, SIPTAG_CONTACT_STR(contact_str), NUTAG_WITH_THIS(nua), 
                                                SIPTAG_SUBSCRIPTION_STATE_STR(sstr),