mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-05 20:51:51 +00:00
fixing term svc change mem leak issue
This commit is contained in:
parent
4a1c7bcf70
commit
a68e52fa67
@ -108,7 +108,6 @@ S16 mg_fill_mgco_termid ( MgMgcoTermId *termId, char* term_str, int term_len, C
|
|||||||
termId->type.pres = PRSNT_NODEF;
|
termId->type.pres = PRSNT_NODEF;
|
||||||
|
|
||||||
if(!strcmp(term_str,"ROOT")){
|
if(!strcmp(term_str,"ROOT")){
|
||||||
/* ROOT Termination */
|
|
||||||
termId->type.val = MGT_TERMID_ROOT;
|
termId->type.val = MGT_TERMID_ROOT;
|
||||||
} else {
|
} else {
|
||||||
termId->type.val = MGT_TERMID_OTHER;
|
termId->type.val = MGT_TERMID_OTHER;
|
||||||
@ -117,19 +116,12 @@ S16 mg_fill_mgco_termid ( MgMgcoTermId *termId, char* term_str, int term_len, C
|
|||||||
termId->name.dom.len = 0x00;
|
termId->name.dom.len = 0x00;
|
||||||
|
|
||||||
termId->name.pres.pres = PRSNT_NODEF;
|
termId->name.pres.pres = PRSNT_NODEF;
|
||||||
termId->name.lcl.pres = PRSNT_NODEF;
|
|
||||||
termId->name.lcl.len = term_len;
|
|
||||||
MG_GETMEM(termId->name.lcl.val, termId->name.lcl.len , memCp, ret);
|
|
||||||
//ret = mg_stack_alloc_mem((Ptr*)&termId->name.lcl.val,term_len);
|
|
||||||
|
|
||||||
if( ret != ROK)
|
MG_SET_TKNSTROSXL(termId->name.lcl,term_len,term_str,memCp);
|
||||||
RETVALUE(ret);
|
|
||||||
|
|
||||||
/*cmMemcpy((U8*)(termId->name.lcl.val), (CONSTANT U8*)term_str,termId->name.lcl.len);*/
|
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
|
||||||
strncpy((char*)(termId->name.lcl.val), term_str, termId->name.lcl.len);
|
"mg_fill_mgco_termid: name.lcl.val[%s], len[%d], term_str[%s], term_len[%d]\n",
|
||||||
termId->name.lcl.val[termId->name.lcl.len] = '\0';
|
termId->name.lcl.val, termId->name.lcl.len, term_str,term_len);
|
||||||
|
|
||||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,"mg_fill_mgco_termid: name.lcl.val[%s], len[%d], term_str[%s], term_len[%d]\n",termId->name.lcl.val, termId->name.lcl.len, term_str,term_len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user