Sfoglia il codice sorgente

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 anni fa
parent
commit
959eb339a4
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  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;
 }