fix array allocation and deletion

This commit is contained in:
2025-11-21 11:46:25 +01:00
parent b10dd5cd59
commit 603d702117

View File

@@ -315,8 +315,7 @@ void Engine::regexp() {
// record end // record end
mode = "key"; mode = "key";
if(config.token != "") { if(config.token != "") {
//char **subs = new char*[2]; string *subs = new string[2];
char *subs[2];
num = pcre2_match(p_pcre, (PCRE2_SPTR)line.c_str(), (PCRE2_SIZE)line.length(), 0, 0, match_data, NULL); num = pcre2_match(p_pcre, (PCRE2_SPTR)line.c_str(), (PCRE2_SIZE)line.length(), 0, 0, match_data, NULL);
@@ -349,7 +348,7 @@ void Engine::regexp() {
} }
} }
//delete(subs); delete[] subs;
line = ""; line = "";