Browse code

- fix: double free on error (bad RE)

Andrei Pelinescu-Onciul authored on 05/05/2008 18:15:54
Showing 1 changed files
... ...
@@ -231,6 +231,7 @@ found_repl:
231 231
 	*re_end=0;
232 232
 	if (regcomp(regex, re, cflags)!=0){
233 233
 		pkg_free(regex);
234
+		regex=0;
234 235
 		*re_end=c; /* restore */
235 236
 		LOG(L_ERR, "ERROR: subst_parser: bad regular expression %.*s in "
236 237
 				"%.*s\n", (int)(re_end-re), re, subst->len, subst->s);