Browse code

topoh: free nbuf

- fixed leak due to no free of new buffer
- reported by Libor Chocholaty
(cherry picked from commit 198e468b7d83bb62d0761dd45e5c6820bc75a61a)

Daniel-Constantin Mierla authored on 07/04/2010 20:56:46 • Andrei Pelinescu-Onciul committed on 28/05/2010 18:48:36
Showing 1 changed files
... ...
@@ -169,7 +169,7 @@ int th_msg_received(void *data)
169 169
 {
170 170
 	sip_msg_t msg;
171 171
 	str *obuf;
172
-	char *nbuf;
172
+	char *nbuf = NULL;
173 173
 	int direction;
174 174
 	int dialog;
175 175
 
... ...
@@ -241,6 +241,8 @@ int th_msg_received(void *data)
241 241
 	obuf->s[obuf->len] = '\0';
242 242
 
243 243
 done:
244
+	if(nbuf!=NULL)
245
+		pkg_free(nbuf);
244 246
 	free_sip_msg(&msg);
245 247
 	return 0;
246 248
 }