From: Michael Tremer Date: Tue, 16 Aug 2022 10:35:15 +0000 (+0000) Subject: writer: Check if stringpool has been initialized before free X-Git-Tag: 0.9.15~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=156f2ea52551718914528ca1997e2b18ac35232d;p=location%2Flibloc.git writer: Check if stringpool has been initialized before free Signed-off-by: Michael Tremer --- diff --git a/src/writer.c b/src/writer.c index 9ca87cb..03599c9 100644 --- a/src/writer.c +++ b/src/writer.c @@ -172,7 +172,8 @@ static void loc_writer_free(struct loc_writer* writer) { loc_network_tree_unref(writer->networks); // Unref the string pool - loc_stringpool_unref(writer->pool); + if (writer->pool) + loc_stringpool_unref(writer->pool); loc_unref(writer->ctx); free(writer);