]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
Do not attempt freeing the stringpool when it isn't allocated
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 16 May 2020 10:33:05 +0000 (10:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 16 May 2020 10:33:05 +0000 (10:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.c

index 443ed1eccf5aebf9493d921e7b38833914c56bfc..3ba7bac7f4bf4bd4d2b95af3e09d2ae3aab6e8de 100644 (file)
@@ -408,7 +408,8 @@ static void loc_database_free(struct loc_database* db) {
                        ERROR(db->ctx, "Could not unmap network nodes section: %s\n", strerror(errno));
        }
 
-       loc_stringpool_unref(db->pool);
+       if (db->pool)
+               loc_stringpool_unref(db->pool);
 
        // Free signature
        if (db->signature)