]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
database: Improve error logging when da network could not be loaded
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Jan 2018 22:33:55 +0000 (22:33 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 30 Jan 2018 22:33:55 +0000 (22:33 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.c

index 619d3793094d1e61e9aef68fa87e8275aa91ca90..7c8ea89ab34739b93e519af9dbf2aa871c8985ec 100644 (file)
@@ -450,12 +450,10 @@ static int __loc_database_lookup_handle_leaf(struct loc_database* db, const stru
        // Fetch the network
        int r = loc_database_fetch_network(db, network,
                network_address, prefix, network_index);
-       if (r)
+       if (r) {
+               ERROR(db->ctx, "Could not fetch network %jd from database\n", network_index);
                return r;
-
-       char* s = loc_network_str(*network);
-       DEBUG(db->ctx, "Got network %s\n", s);
-       free(s);
+       }
 
        // Check if the given IP address is inside the network
        r = loc_network_match_address(*network, address);