From 0fa1c2389cd5f0086777500a3f5a77903cd0c552 Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 26 Dec 2015 17:19:52 -0500 Subject: [PATCH] [fix] Leak in expanding strings that have a separable prefix and suffix, other than that ran through 78 million expansions with no discernable memory issues --- src/libpostal.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libpostal.c b/src/libpostal.c index 9474ce5c..752f5156 100644 --- a/src/libpostal.c +++ b/src/libpostal.c @@ -539,6 +539,9 @@ bool add_affix_expansions(string_tree_t *tree, char *str, char *lang, token_t to } } + cstring_array_destroy(root_strings); + root_strings = NULL; + } else { for (int j = 0; j < suffix_expansions->n; j++) { key->n = prefix_end;