Call ac_automata_release with free_pattern = 1 (malloc'ed patterns expected in ndpi_add_string_to_automa)

This commit is contained in:
Alfredo Cardigliano
2021-06-14 14:41:14 +02:00
parent 380286c069
commit 4aefbe0c7a
3 changed files with 10 additions and 7 deletions
+2 -2
View File
@@ -3693,8 +3693,8 @@ void automataUnitTest() {
void *automa = ndpi_init_automa();
assert(automa);
assert(ndpi_add_string_to_automa(automa, "hello") == 0);
assert(ndpi_add_string_to_automa(automa, "world") == 0);
assert(ndpi_add_string_to_automa(automa, strdup("hello")) == 0);
assert(ndpi_add_string_to_automa(automa, strdup("world")) == 0);
ndpi_finalize_automa(automa);
assert(ndpi_match_string(automa, "This is the wonderful world of nDPI") == 1);
ndpi_free_automa(automa);