Those functions have been very inconsistent in that way that some
happily accepted a NULL pointer and others didn't.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
}
LOC_EXPORT struct loc_country_list* loc_country_list_unref(struct loc_country_list* list) {
- if (!list)
- return NULL;
-
if (--list->refcount > 0)
return list;
}
LOC_EXPORT struct loc_ctx* loc_unref(struct loc_ctx* ctx) {
- if (!ctx)
- return NULL;
-
if (--ctx->refcount > 0)
return NULL;
}
LOC_EXPORT struct loc_network_list* loc_network_list_unref(struct loc_network_list* list) {
- if (!list)
- return NULL;
-
if (--list->refcount > 0)
return list;
}
LOC_EXPORT struct loc_network* loc_network_unref(struct loc_network* network) {
- if (!network)
- return NULL;
-
if (--network->refcount > 0)
return network;
}
struct loc_network_tree_node* loc_network_tree_node_unref(struct loc_network_tree_node* node) {
- if (!node)
- return NULL;
-
if (--node->refcount > 0)
return node;
fprintf(stderr, "Could look up 2001:db8:fffe:1::, but I shouldn't\n");
exit(EXIT_FAILURE);
}
- loc_network_unref(network1);
const struct bit_length_test {
const char* network;