197 |
197 |
198 int ucx_properties2map(UcxProperties *parser, UcxMap *map) { |
198 int ucx_properties2map(UcxProperties *parser, UcxMap *map) { |
199 sstr_t name; |
199 sstr_t name; |
200 sstr_t value; |
200 sstr_t value; |
201 while(ucx_properties_next(parser, &name, &value)) { |
201 while(ucx_properties_next(parser, &name, &value)) { |
202 name = sstrdup_alloc(map->allocator, name); |
202 value = sstrdupa(map->allocator, value); |
203 if(!name.ptr) { |
203 if(!value.ptr) { |
204 return 1; |
204 return 1; |
205 } |
205 } |
206 value = sstrdup_alloc(map->allocator, value); |
|
207 if(!value.ptr) { |
|
208 map->allocator->free(map->allocator->pool, value.ptr); |
|
209 return 1; |
|
210 } |
|
211 if(ucx_map_sstr_put(map, name, value.ptr)) { |
206 if(ucx_map_sstr_put(map, name, value.ptr)) { |
212 map->allocator->free(map->allocator->pool, name.ptr); |
|
213 map->allocator->free(map->allocator->pool, value.ptr); |
207 map->allocator->free(map->allocator->pool, value.ptr); |
214 return 1; |
208 return 1; |
215 } |
209 } |
216 } |
210 } |
217 if(parser->error) { |
211 if(parser->error) { |