{
struct sim_manager_data *sim = modem->sim_manager;
int total;
- struct ofono_phone_number *ph;
+ struct ofono_phone_number ph;
if (!ok)
goto check;
total = length / record_length;
- ph = g_new(struct ofono_phone_number, 1);
+ if (sim_adn_parse(data, record_length, &ph) == TRUE) {
+ struct ofono_phone_number *own;
- if (sim_adn_parse(data, record_length, ph) == FALSE) {
- g_free(ph);
- goto check;
+ own = g_new(struct ofono_phone_number, 1);
+ memcpy(own, &ph, sizeof(struct ofono_phone_number));
+ sim->own_numbers = g_slist_prepend(sim->own_numbers, own);
}
- sim->own_numbers = g_slist_prepend(sim->own_numbers, ph);
-
if (record != total)
return;