Browse code

siptrace: free parsed from in case of errors

Federico Cabiddu authored on 22/04/2020 09:40:58
Showing 1 changed files
... ...
@@ -1383,7 +1383,7 @@ static void trace_onreq_out(struct cell *t, int type, struct tmcb_params *ps)
1383 1383
 	}
1384 1384
 
1385 1385
 	if(sip_trace_msg_attrs(msg, &sto) < 0) {
1386
-		return;
1386
+		return; 
1387 1387
 	}
1388 1388
 
1389 1389
 	if(ps->send_buf.len > 0) {
... ...
@@ -1616,7 +1616,7 @@ static void trace_onreply_out(struct cell *t, int type, struct tmcb_params *ps)
1616 1616
 	}
1617 1617
 
1618 1618
 	if(sip_trace_msg_attrs(msg, &sto) < 0) {
1619
-		return;
1619
+		goto end;
1620 1620
 	}
1621 1621
 
1622 1622
 	if(faked == 0) {
... ...
@@ -1662,7 +1662,7 @@ static void trace_onreply_out(struct cell *t, int type, struct tmcb_params *ps)
1662 1662
 	sto.status.s = int2strbuf(ps->code, statusbuf, INT2STR_MAX_LEN, &sto.status.len);
1663 1663
 	if(sto.status.s == 0) {
1664 1664
 		LM_ERR("failure to get the status string\n");
1665
-		return;
1665
+		goto end;
1666 1666
 	}
1667 1667
 
1668 1668
 	memset(&to_ip, 0, sizeof(struct ip_addr));
... ...
@@ -1700,7 +1700,7 @@ static void trace_onreply_out(struct cell *t, int type, struct tmcb_params *ps)
1700 1700
 end:
1701 1701
 	if (faked && parsed_f) {
1702 1702
 		free_from(msg->from->parsed);
1703
-    msg->from->parsed = NULL;
1703
+		msg->from->parsed = NULL;
1704 1704
 	}
1705 1705
 }
1706 1706