Browse code

- avoid compiler warning - don't free str in fixup call to select_anyheader - xlog knows how to parse and call select, just use %@select[1]

Michal Matyska authored on 17/02/2006 22:32:02
Showing 2 changed files
... ...
@@ -65,6 +65,9 @@ int resolve_select(select_t* s)
65 65
 		case SEL_PARAM_INT:
66 66
 			DBG("resolve_select: [%d]\n", s->params[param_idx].v.i);
67 67
 			break;
68
+		case SEL_PARAM_DIV:
69
+			/* just to avoid the warning */
70
+			break;
68 71
 		}
69 72
 		for (t=select_list; t; t=t->next) {
70 73
 			table_idx = 0;	
... ...
@@ -485,7 +485,11 @@ int select_anyheader(str* res, select_t* s, struct sip_msg* msg)
485 485
 			s->params[1].v.s.s[s->params[1].v.s.len]=c;
486 486
 			
487 487
 			if (hdr.type!=HDR_OTHER_T && hdr.type!=HDR_ERROR_T) {
488
-				pkg_free(s->params[1].v.s.s);
488
+				/* pkg_free(s->params[1].v.s.s); */
489
+				/* don't free it (the mem can leak only once at startup)
490
+				 * the parsed string can live inside larger string block
491
+				 * e.g. when xlog's select is parsed
492
+				 */
489 493
 				s->params[1].type = SEL_PARAM_DIV;
490 494
 				s->params[1].v.i = hdr.type;
491 495
 			}