summaryrefslogtreecommitdiffstats
path: root/src/strindex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/strindex.c')
-rw-r--r--src/strindex.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/strindex.c b/src/strindex.c
index 6443a59..9a6d952 100644
--- a/src/strindex.c
+++ b/src/strindex.c
@@ -82,10 +82,12 @@ zix_strindex_free_rec(ZixStrindexNode* n)
void
zix_strindex_free(ZixStrindex* strindex)
{
- zix_strindex_free_rec(strindex->root);
- free(strindex->s);
- free(strindex->root);
- free(strindex);
+ if (strindex) {
+ zix_strindex_free_rec(strindex->root);
+ free(strindex->s);
+ free(strindex->root);
+ free(strindex);
+ }
}
static inline int