- fix: doing strlen(bodybuff) after having free()d it

found by dmalloc memory poisoning
- fix: new branch id hash calculation was not working properly
  (dont check return status in osip_xxx_to_str() functions -
  the docu does not say anything about them (looks like 0 == success)
  but better check the returnet string pointer value -> NULL = failed)
  This resulted in a memory leak an imporper calculated MD5 hash.
This commit is contained in:
Thomas Ries
2004-01-28 01:06:28 +00:00
parent fe9beb76d5
commit 230c3d3ffb
4 changed files with 12 additions and 16 deletions

View File

@@ -710,7 +710,6 @@ if (configuration.debuglevel)
/* include new body */
osip_message_set_body(mymsg, bodybuff);
osip_free(bodybuff);
/* free content length resource and include new one*/
osip_content_length_free(mymsg->content_length);
@@ -718,6 +717,9 @@ if (configuration.debuglevel)
sprintf(clen,"%i",strlen(bodybuff));
sts = osip_message_set_content_length(mymsg, clen);
/* free old body */
osip_free(bodybuff);
if (configuration.debuglevel)
{ /* just dump the buffer */
char *tmp, *tmp2;