Hello Denis, On 08/12/2011 09:55 AM, Denis Kenzior wrote: >> +static struct ofono_gprs_provision_data *apn_try_new(struct parser_data *data) >> +{ >> + void *p; >> + >> + p = g_try_realloc(*data->settings, >> + sizeof(struct ofono_gprs_provision_data) * >> + (data->count + 1)); >> + if (p == NULL) >> + return NULL; >> + >> + *data->settings = p; >> + >> + data->context = *data->settings + data->count++; >> + >> + memset(data->context, 0, sizeof(struct ofono_gprs_provision_data)); > > This seems like a really big hammer. We have 3 settings we're likely to > provision, internet, wap, mms. The function runs synchronously and > oFono is not threaded. So in theory you can allocate the context > information statically and only copy it to the caller once you have > completed the parser. Hmm, statically allocated array of settings was in the previous version. Then the wish was to make it dynamic and to use realloc. Can we settle on an approach here? Regards, Oleg -- Intel Finland Oy Registered Address: PL 281, 00181 Helsinki Business Identity Code: 0357606 - 4 Domiciled in Helsinki