Compare commits

..

3 commits

Author SHA1 Message Date
d7da8e0a54 Merge pull request 'Fix potential double-free issue in Cytoplasm' (#22) from lda/Cytoplasm:fix-router-issue into master
Reviewed-on: #22
2024-01-04 19:32:57 -05:00
lda
44b7f45bb7 [FIX] Fix other potential double-free
Was done "à la va-vite" since I can't really work on it directly right now.
2024-01-01 07:57:11 -05:00
lda
3788d044e6
[FIX] Fix potential double-free issue in Cytoplasm 2023-12-14 18:31:20 +01:00

View file

@ -237,7 +237,6 @@ HttpRouterRoute(HttpRouter * router, char *path, void *args, void **ret)
{ {
if (regexec(&val->regex, pathPart, REG_MAX_SUB, pmatch, 0) == 0) if (regexec(&val->regex, pathPart, REG_MAX_SUB, pmatch, 0) == 0)
{ {
Free(pathPart);
break; break;
} }
@ -268,7 +267,6 @@ HttpRouterRoute(HttpRouter * router, char *path, void *args, void **ret)
substr = StrSubstr(pathPart, cpmatch.rm_so, cpmatch.rm_eo); substr = StrSubstr(pathPart, cpmatch.rm_so, cpmatch.rm_eo);
if (pmatch[i].rm_so == -1) if (pmatch[i].rm_so == -1)
{ {
Free(pathPart);
break; break;
} }