فهرست منبع

core: safety check for free contact

- patch by Sebastian Z., checking if the content is null before freeing
  it
Daniel-Constantin Mierla 15 سال پیش
والد
کامیت
7aed7d72c9
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      parser/contact/parse_contact.c

+ 2 - 0
parser/contact/parse_contact.c

@@ -102,6 +102,8 @@ int parse_contact(struct hdr_field* _h)
  */
  */
 void free_contact(contact_body_t** _c)
 void free_contact(contact_body_t** _c)
 {
 {
+	if(*_c==NULL)
+		return;
 	if ((*_c)->contacts) {
 	if ((*_c)->contacts) {
 		free_contacts(&((*_c)->contacts));
 		free_contacts(&((*_c)->contacts));
 	}
 	}