[fix] Moving address_parser_response_destroy into libpostal so caller can free

This commit is contained in:
Al
2015-12-15 00:52:24 -05:00
parent ab3ba249d7
commit b9bf5c629e
4 changed files with 30 additions and 26 deletions

View File

@@ -801,31 +801,6 @@ address_parser_response_t *address_parser_response_new(void) {
return response;
}
void address_parser_response_destroy(address_parser_response_t *self) {
if (self == NULL) return;
for (int i = 0; i < self->num_components; i++) {
if (self->components != NULL) {
free(self->components[i]);
}
if (self->labels != NULL) {
free(self->labels[i]);
}
}
if (self->components != NULL) {
free(self->components);
}
if (self->labels != NULL) {
free(self->labels);
}
free(self);
}
address_parser_response_t *address_parser_parse(char *address, char *language, char *country, address_parser_context_t *context) {
if (address == NULL || context == NULL) return NULL;