]> git.ipfire.org Git - location/libloc.git/commitdiff
writer: Check if stringpool has been initialized before free
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 16 Aug 2022 10:35:15 +0000 (10:35 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 16 Aug 2022 10:35:15 +0000 (10:35 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/writer.c

index 9ca87cba87f35295c3f3f88a31b29f82d42a0303..03599c91394271254b9d55ad5b33dc54838a9498 100644 (file)
@@ -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);