<p><b>@gaaf</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/kamailio/kamailio/pull/1832#discussion_r303429055">src/modules/dialog/dlg_hash.c</a>:</p>
<pre style='color:#555'>> @@ -528,7 +533,7 @@ int dlg_set_leg_info(struct dlg_cell *dlg, str* tag, str *rr, str *contact,
 
        if(dlg->tag[leg].s)
                shm_free(dlg->tag[leg].s);
-       dlg->tag[leg].s = (char*)shm_malloc( tag->len + rr->len );
</pre>
<p>It is not necessarily decreased, it is just realloc'ed to the size of the new tag, which may be bigger or smaller.</p>
<p>The tag is not "changed" it is stored untouched from the incoming response.</p>
<p>There may be multiple to-tag's in a single dialog as the call may have been forked. The dialog module does not track individual branches separately, it just stores 1 of them, we just hope it is the correct one. When storing the tag of the 200 OK, it may be overwriting a previous tag (from a 1XX response).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/pull/1832?email_source=notifications&email_token=ABO7UZNK4KVYBGH6KEXLNQTP7R2DTA5CNFSM4GTY76Q2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB6NO2FA#discussion_r303429055">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZNFG6Z5TXTSVFXDYQLP7R2DTANCNFSM4GTY76QQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABO7UZJQ3AVQAFW2INVVODTP7R2DTA5CNFSM4GTY76Q2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB6NO2FA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/pull/1832?email_source=notifications\u0026email_token=ABO7UZNK4KVYBGH6KEXLNQTP7R2DTA5CNFSM4GTY76Q2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB6NO2FA#discussion_r303429055",
"url": "https://github.com/kamailio/kamailio/pull/1832?email_source=notifications\u0026email_token=ABO7UZNK4KVYBGH6KEXLNQTP7R2DTA5CNFSM4GTY76Q2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB6NO2FA#discussion_r303429055",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>