Browse code

Bug corrected when parsing xlog's select, which uses DIVERSION flag. It tried to free mem block which was inside allocation block.

Michal Matyska authored on 26/02/2006 16:32:34
Showing 1 changed files
... ...
@@ -29,6 +29,9 @@
29 29
  *  2005-12-19  select framework (mma)
30 30
  *  2006-01-19  multiple nested calls, IS_ALIAS -> NESTED flag renamed (mma)
31 31
  *              DIVERSION flag checked
32
+ *  2006-02-26  don't free str when changing type STR -> DIVERSION (mma)
33
+ *				it can't be freeable sometimes (e.g. xlog's select)
34
+ *
32 35
  */
33 36
 
34 37
 
... ...
@@ -99,7 +102,11 @@ int resolve_select(select_t* s)
99 102
 
100 103
 		accepted:
101 104
 		if (t->table[table_idx].flags & DIVERSION) {
102
-			if (s->params[param_idx].type == SEL_PARAM_STR) pkg_free(s->params[param_idx].v.s.s);
105
+			/* if (s->params[param_idx].type == SEL_PARAM_STR) pkg_free(s->params[param_idx].v.s.s); */
106
+			/* don't free it (the mem can leak only once at startup)
107
+			 * the parsed string can live inside larger string block
108
+			 * e.g. when xlog's select is parsed
109
+			 */
103 110
 			s->params[param_idx].type = SEL_PARAM_DIV;
104 111
 			s->params[param_idx].v.i = t->table[table_idx].flags & DIVERSION_MASK;
105 112