Skip to content

Commit 1bd0c0d

Browse files
committed
Fix: check_regex() is always true
1 parent 85a4480 commit 1bd0c0d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/strings.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,9 +2310,9 @@ expand_regex(char ***substr)
23102310
const size_t l = strlen(t) + 3;
23112311
char *rstr = xnmalloc(l, sizeof(char));
23122312
snprintf(rstr, l, "^%s$", t);
2313-
free(dstr);
23142313

2315-
const int ret = check_regex(rstr);
2314+
const int ret = check_regex(dstr);
2315+
free(dstr);
23162316

23172317
if (ret != FUNC_SUCCESS
23182318
|| regcomp(&regex, rstr, reg_flags) != FUNC_SUCCESS) {

0 commit comments

Comments
 (0)