| 186 | } |
| 187 | |
| 188 | cs_error_t icmap_init_r(icmap_map_t *result) |
| 189 | { |
| 190 | int32_t err; |
| 191 | |
| 192 | *result = malloc(sizeof(struct icmap_map)); |
| 193 | if (*result == NULL) { |
| 194 | return (CS_ERR_NO_MEMORY); |
| 195 | } |
| 196 | |
| 197 | (*result)->qb_map = qb_trie_create(); |
| 198 | if ((*result)->qb_map == NULL) { |
| 199 | free(*result); |
| 200 | return (CS_ERR_INIT); |
| 201 | } |
| 202 | |
| 203 | err = qb_map_notify_add((*result)->qb_map, NULL, icmap_map_free_cb, QB_MAP_NOTIFY_FREE, NULL); |
| 204 | if (err != 0) { |
| 205 | qb_map_destroy((*result)->qb_map); |
| 206 | free(*result); |
| 207 | } |
| 208 | |
| 209 | return (qb_to_cs_error(err)); |
| 210 | } |
| 211 | |
| 212 | cs_error_t icmap_init(void) |
| 213 | { |
no test coverage detected