소스 검색

topoh: free nbuf

- fixed leak due to no free of new buffer
- reported by Libor Chocholaty
(cherry picked from commit 198e468b7d83bb62d0761dd45e5c6820bc75a61a)
Daniel-Constantin Mierla 15 년 전
부모
커밋
959eb339a4
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      modules/topoh/topoh_mod.c

+ 3 - 1
modules/topoh/topoh_mod.c

@@ -169,7 +169,7 @@ int th_msg_received(void *data)
 {
 	sip_msg_t msg;
 	str *obuf;
-	char *nbuf;
+	char *nbuf = NULL;
 	int direction;
 	int dialog;
 
@@ -241,6 +241,8 @@ int th_msg_received(void *data)
 	obuf->s[obuf->len] = '\0';
 
 done:
+	if(nbuf!=NULL)
+		pkg_free(nbuf);
 	free_sip_msg(&msg);
 	return 0;
 }