Changeset 1398


Ignore:
Timestamp:
Jun 28, 2007 2:47:32 AM (12 years ago)
Author:
bennylp
Message:

Ticket #349: Crash when sending PUBLISH when network is unreachable

Location:
pjproject/trunk/pjsip/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-simple/publishc.c

    r1292 r1398  
    597597                                      &tsx_callback); 
    598598    if (status!=PJ_SUCCESS) { 
    599         --pubc->pending_tsx; 
     599        // no need to decrement, callback has been called and it should 
     600        // already decremented pending_tsx. Decrementing this here may  
     601        // cause accessing freed memory location. 
     602        //--pubc->pending_tsx; 
    600603        PJ_LOG(4,(THIS_FILE, "Error sending request, status=%d", status)); 
    601604    } 
     
    604607} 
    605608 
    606  
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c

    r1396 r1398  
    700700 
    701701on_error: 
    702     pjsip_publishc_destroy(acc->publish_sess); 
    703     acc->publish_sess = NULL; 
     702    if (acc->publish_sess) { 
     703        pjsip_publishc_destroy(acc->publish_sess); 
     704        acc->publish_sess = NULL; 
     705    } 
    704706    return status; 
    705707} 
     
    736738 
    737739        /* Add credential for authentication */ 
    738         pjsip_publishc_set_credentials(acc->publish_sess, acc->cred_cnt,  
    739                                        acc->cred); 
     740        if (acc->cred_cnt) { 
     741            pjsip_publishc_set_credentials(acc->publish_sess, acc->cred_cnt,  
     742                                           acc->cred); 
     743        } 
    740744 
    741745        /* Set route-set */ 
Note: See TracChangeset for help on using the changeset viewer.