]> git.ipfire.org Git - location/libloc.git/blobdiff - src/writer.c
location-importer.in: skip networks with unknown country codes
[location/libloc.git] / src / writer.c
index 160650fa316d1519a8d6705855cebfbedede088c..c61a6dfc657e92c1f552207f9af81cf671cb38da 100644 (file)
@@ -154,6 +154,14 @@ static void loc_writer_free(struct loc_writer* writer) {
                free(writer->as);
        }
 
+       // Unref all countries
+       if (writer->countries) {
+               for (unsigned int i = 0; i < writer->countries_count; i++) {
+                       loc_country_unref(writer->countries[i]);
+               }
+               free(writer->countries);
+       }
+
        // Release network tree
        if (writer->networks)
                loc_network_tree_unref(writer->networks);
@@ -604,7 +612,7 @@ static int loc_writer_create_signature(struct loc_writer* writer,
                goto END;
        }
 
-       DEBUG(writer->ctx, "Successfully generated signature of %lu bytes\n", *length);
+       DEBUG(writer->ctx, "Successfully generated signature of %zu bytes\n", *length);
        r = 0;
 
        // Dump signature