diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2009-08-12 18:45:51 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2009-08-12 18:45:51 +0200 |
commit | 9b25065810fca6e0238c4c98ec3c09ba4d8abc35 (patch) | |
tree | 2b5ce92c3e673b0fd0e379babde27a41ed055883 | |
parent | aa425c42389921dc4a71561c701014bf443f8094 (diff) |
Free config and regex sets before exiting.
Free the regex sets array after freeing compiled pcre patterns.
-rw-r--r-- | config.c | 3 | ||||
-rw-r--r-- | main.c | 6 | ||||
-rw-r--r-- | regexset.c | 2 |
3 files changed, 11 insertions, 0 deletions
@@ -45,3 +45,6 @@ int cfg_init() { return 1; } +void cfg_free() { + config_destroy(&config); +} @@ -12,5 +12,11 @@ int main(int argc, char **argv) { rs_free(); return 1; } + + /* Parsing stuff goes here. */ + + cfg_free(); + rs_free(); + return 0; } @@ -57,4 +57,6 @@ void rs_free() { pcre_free(regexes[i].text); pcre_free(regexes[i].join); } + free(regexes); + regexes = NULL; } |