only allocate/memcpy to-tag if len>0

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1540 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Stefan Sayer 17 years ago
parent 1dd3278ae3
commit 072649d40f

@ -1074,9 +1074,14 @@ int trans_layer::update_uac_reply(trans_bucket* bucket, sip_trans* t, sip_msg* m
t->reset_timer(STIMER_L, L_TIMER, bucket->get_id());
t->to_tag.s = new char[to_tag.len];
t->to_tag.len = to_tag.len;
memcpy((void*)t->to_tag.s,to_tag.s,to_tag.len);
if (t->to_tag.len>0) {
t->to_tag.s = new char[to_tag.len];
t->to_tag.len = to_tag.len;
memcpy((void*)t->to_tag.s,to_tag.s,to_tag.len);
} else {
t->to_tag.s = NULL;
t->to_tag.len = 0;
}
goto pass_reply;

Loading…
Cancel
Save