MCPcopy Create free account
hub / github.com/corosync/corosync / icmap_init_r

Function icmap_init_r

exec/icmap.c:188–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188cs_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
212cs_error_t icmap_init(void)
213{

Callers 2

icmap_initFunction · 0.85

Calls 1

qb_to_cs_errorFunction · 0.85

Tested by

no test coverage detected