Browse code

sip: fix memory leak while sending 200/ACK

Raphael Coeffic authored on 13/05/2014 09:34:05
Showing 1 changed files
... ...
@@ -1333,9 +1333,11 @@ int _trans_layer::send_request(sip_msg* msg, trans_ticket* tt,
1333 1333
 	    return err;
1334 1334
 	}
1335 1335
 
1336
-	if(tt->_t) {
1336
+	if(tt->_t && (method != sip_request::ACK)) {
1337 1337
 	    // save flags & target set in transaction
1338 1338
 	    tt->_t->flags = flags;
1339
+
1340
+	    if(tt->_t->targets)	delete tt->_t->targets;
1339 1341
 	    tt->_t->targets = targets.release();
1340 1342
 
1341 1343
 	    if(tt->_t->targets->has_next()){