Browse code

Free allocated structure if the parser returns error.

Michal Matyska authored on 12/06/2006 11:40:16
Showing 1 changed files
... ...
@@ -128,6 +128,7 @@ int parse_select (char** p, select_t** s)
128 128
 		return -1;
129 129
 	}
130 130
 	if (w_parse_select(p, sel)<0) {
131
+		pkg_free(sel);
131 132
 		return -2;
132 133
 	}
133 134
 	*s=sel;
... ...
@@ -144,6 +145,7 @@ int shm_parse_select (char** p, select_t** s)
144 144
 		return -1;
145 145
 	}
146 146
 	if (w_parse_select(p, sel)<0) {
147
+		shm_free(sel);
147 148
 		return -2;
148 149
 	}
149 150
 	*s=sel;