]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
database: Free stringpool only after it has been initialised
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 26 Sep 2019 17:45:16 +0000 (17:45 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 26 Sep 2019 17:45:16 +0000 (17:45 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.c

index fe5e6dc6e0ebcb86a56b5629dc982ff5bc879ff1..58e1c00bf234d09b8302b20c14caf6fe53f3140e 100644 (file)
@@ -306,7 +306,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);
 
        loc_unref(db->ctx);
        free(db);