aboutsummaryrefslogtreecommitdiff
path: root/example/ndpiReader.c
diff options
context:
space:
mode:
authorAlfredo Cardigliano <cardigliano@ntop.org>2021-06-14 14:41:14 +0200
committerAlfredo Cardigliano <cardigliano@ntop.org>2021-06-14 14:41:14 +0200
commit4aefbe0c7a665ee077b3ddbfc0c7738cd7333558 (patch)
tree8feed32859899427e3ebf9339951284db487ad6a /example/ndpiReader.c
parent380286c06974451bed47f14455272f051f809cbe (diff)
Call ac_automata_release with free_pattern = 1 (malloc'ed patterns expected in ndpi_add_string_to_automa)
Diffstat (limited to 'example/ndpiReader.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index fceffa30a..b4153c8bf 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -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);