Browse Source

ims_isc: free allocated route in case of error

Daniel-Constantin Mierla 4 months ago
parent
commit
76a72a0092
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/modules/ims_isc/mark.c

+ 2 - 1
src/modules/ims_isc/mark.c

@@ -348,7 +348,7 @@ int isc_mark_write_route(struct sip_msg *msg, str *as, str *iscmark)
 {
 	struct hdr_field *first;
 	struct lump *anchor;
-	str route;
+	str route = STR_NULL;
 
 	parse_headers(msg, HDR_EOH_F, 0);
 	first = msg->headers;
@@ -367,6 +367,7 @@ int isc_mark_write_route(struct sip_msg *msg, str *as, str *iscmark)
 	anchor = anchor_lump(msg, first->name.s - msg->buf, 0, HDR_ROUTE_T);
 	if(anchor == NULL) {
 		LM_ERR("isc_mark_write_route: anchor_lump failed\n");
+		pkg_free(route.s);
 		return 0;
 	}