diff --git a/src/address_parser.c b/src/address_parser.c index 9cfa17a6..2b7c8811 100644 --- a/src/address_parser.c +++ b/src/address_parser.c @@ -1755,8 +1755,6 @@ libpostal_address_parser_response_t *address_parser_parse(char *address, char *l label = strdup(ADDRESS_PARSER_LABEL_POSTAL_CODE); } - response = address_parser_response_new(); - // Implicit: if most_common is not one of the above, ignore and parse regularly if (label != NULL) { char **single_label = malloc(sizeof(char *)); @@ -1764,6 +1762,8 @@ libpostal_address_parser_response_t *address_parser_parse(char *address, char *l char **single_component = malloc(sizeof(char *)); single_component[0] = strdup(normalized); + response = address_parser_response_new(); + response->num_components = 1; response->labels = single_label; response->components = single_component;