[sr-dev] git:master: core: safety check for free contact

Daniel-Constantin Mierla miconda at gmail.com
Tue Jun 29 19:51:27 CEST 2010


Module: sip-router
Branch: master
Commit: 7aed7d72c98a8228e9687773c3bab20d8934251a
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7aed7d72c98a8228e9687773c3bab20d8934251a

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Tue Jun 29 19:48:59 2010 +0200

core: safety check for free contact

- patch by Sebastian Z., checking if the content is null before freeing
  it

---

 parser/contact/parse_contact.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/parser/contact/parse_contact.c b/parser/contact/parse_contact.c
index 0f7398d..eb28763 100644
--- a/parser/contact/parse_contact.c
+++ b/parser/contact/parse_contact.c
@@ -102,6 +102,8 @@ int parse_contact(struct hdr_field* _h)
  */
 void free_contact(contact_body_t** _c)
 {
+	if(*_c==NULL)
+		return;
 	if ((*_c)->contacts) {
 		free_contacts(&((*_c)->contacts));
 	}




More information about the sr-dev mailing list