소스 검색

core: safety check for free contact

- patch by Sebastian Z., checking if the content is null before freeing
  it
(cherry picked from commit 7aed7d72c98a8228e9687773c3bab20d8934251a)
Daniel-Constantin Mierla 15 년 전
부모
커밋
99a0c0e3c4
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));
 	}
 	}