@@ -68,8 +68,8 @@ void ofono_audio_settings_mode_notify(struct ofono_audio_settings *as,
DBG("mode %s", mode);
- g_free(as->mode);
- as->mode = g_strdup(mode);
+ l_free(as->mode);
+ as->mode = l_strdup(mode);
if (as->mode == NULL)
return;
@@ -151,7 +151,7 @@ static void audio_settings_remove(struct ofono_atom *atom)
if (as->driver && as->driver->remove)
as->driver->remove(as);
- g_free(as->mode);
+ l_free(as->mode);
g_free(as);
}
@@ -602,7 +602,7 @@ static void cbs_unregister(struct ofono_atom *atom)
if (cbs->settings) {
storage_close(cbs->imsi, SETTINGS_STORE, cbs->settings, TRUE);
- g_free(cbs->imsi);
+ l_free(cbs->imsi);
cbs->imsi = NULL;
cbs->settings = NULL;
}
@@ -868,7 +868,7 @@ static void cbs_got_imsi(struct ofono_cbs *cbs)
if (cbs->settings == NULL)
return;
- cbs->imsi = g_strdup(imsi);
+ cbs->imsi = l_strdup(imsi);
cbs->topics = NULL;
@@ -1138,7 +1138,7 @@ static void emulator_add_indicator(struct ofono_emulator *em, const char* name,
return;
}
- ind->name = g_strdup(name);
+ ind->name = l_strdup(name);
ind->min = min;
ind->max = max;
ind->value = dflt;
@@ -1163,7 +1163,7 @@ static void emulator_unregister(struct ofono_atom *atom)
for (l = em->indicators; l; l = l->next) {
struct indicator *ind = l->data;
- g_free(ind->name);
+ l_free(ind->name);
g_free(ind);
}
@@ -113,8 +113,8 @@ void gnss_agent_free(struct gnss_agent *agent)
if (agent->removed_cb)
agent->removed_cb(agent->removed_data);
- g_free(agent->path);
- g_free(agent->bus);
+ l_free(agent->path);
+ l_free(agent->bus);
g_free(agent);
}
@@ -135,8 +135,8 @@ struct gnss_agent *gnss_agent_new(const char *path, const char *sender)
if (agent == NULL)
return NULL;
- agent->path = g_strdup(path);
- agent->bus = g_strdup(sender);
+ agent->path = l_strdup(path);
+ agent->bus = l_strdup(sender);
agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender,
gnss_agent_disconnect_cb,
@@ -465,10 +465,8 @@ void *ofono_handsfree_card_get_data(struct ofono_handsfree_card *card)
void ofono_handsfree_card_set_remote(struct ofono_handsfree_card *card,
const char *remote)
{
- if (card->remote)
- g_free(card->remote);
-
- card->remote = g_strdup(remote);
+ l_free(card->remote);
+ card->remote = l_strdup(remote);
}
const char *ofono_handsfree_card_get_remote(struct ofono_handsfree_card *card)
@@ -479,10 +477,8 @@ const char *ofono_handsfree_card_get_remote(struct ofono_handsfree_card *card)
void ofono_handsfree_card_set_local(struct ofono_handsfree_card *card,
const char *local)
{
- if (card->local)
- g_free(card->local);
-
- card->local = g_strdup(local);
+ l_free(card->local);
+ card->local = l_strdup(local);
}
const char *ofono_handsfree_card_get_local(struct ofono_handsfree_card *card)
@@ -581,7 +577,7 @@ int ofono_handsfree_card_register(struct ofono_handsfree_card *card)
next_card_id += 1;
- card->path = g_strdup(path);
+ card->path = l_strdup(path);
emit_card_added(card);
return 0;
@@ -606,7 +602,7 @@ static void card_unregister(struct ofono_handsfree_card *card)
emit_card_removed(card);
- g_free(card->path);
+ l_free(card->path);
card->path = NULL;
}
@@ -622,8 +618,8 @@ void ofono_handsfree_card_remove(struct ofono_handsfree_card *card)
card_list = g_slist_remove(card_list, card);
- g_free(card->remote);
- g_free(card->local);
+ l_free(card->remote);
+ l_free(card->local);
if (card->driver && card->driver->remove)
card->driver->remove(card);
@@ -663,8 +659,8 @@ static void agent_free(struct agent *agent)
if (agent->watch > 0)
g_dbus_remove_watch(ofono_dbus_get_connection(), agent->watch);
- g_free(agent->owner);
- g_free(agent->path);
+ l_free(agent->owner);
+ l_free(agent->path);
g_free(agent);
}
@@ -789,8 +785,8 @@ static DBusMessage *am_agent_register(DBusConnection *conn,
}
agent = g_new0(struct agent, 1);
- agent->owner = g_strdup(sender);
- agent->path = g_strdup(path);
+ agent->owner = l_strdup(sender);
+ agent->path = l_strdup(path);
agent->watch = g_dbus_add_disconnect_watch(conn, sender,
agent_disconnect, NULL, NULL);
@@ -100,7 +100,7 @@ static void client_remove(struct ofono_location_reporting *lr)
lr->disconnect_watch = 0;
}
- g_free(lr->client_owner);
+ l_free(lr->client_owner);
}
static void signal_enabled(const struct ofono_location_reporting *lr)
@@ -178,7 +178,7 @@ static void location_reporting_enable_cb(const struct ofono_error *error,
}
lr->enabled = TRUE;
- lr->client_owner = g_strdup(dbus_message_get_sender(lr->pending));
+ lr->client_owner = l_strdup(dbus_message_get_sender(lr->pending));
lr->disconnect_watch = g_dbus_add_disconnect_watch(conn,
lr->client_owner, client_exited, lr, NULL);
@@ -85,8 +85,8 @@ void netmon_agent_free(struct netmon_agent *agent)
if (agent->removed_cb)
agent->removed_cb(agent->removed_data);
- g_free(agent->path);
- g_free(agent->bus);
+ l_free(agent->path);
+ l_free(agent->bus);
g_free(agent);
}
@@ -110,8 +110,8 @@ struct netmon_agent *netmon_agent_new(const char *path,
if (agent == NULL)
return NULL;
- agent->bus = g_strdup(sender);
- agent->path = g_strdup(path);
+ agent->bus = l_strdup(sender);
+ agent->path = l_strdup(path);
agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender,
netmon_agent_disconnect_cb,
@@ -245,7 +245,7 @@ static void print_number(gpointer pointer, gpointer user_data)
static void destroy_number(gpointer pointer)
{
struct phonebook_number *pn = pointer;
- g_free(pn->number);
+ l_free(pn->number);
g_free(pn);
}
@@ -268,9 +268,9 @@ static void destroy_merged_entry(gpointer pointer)
{
struct phonebook_person *person = pointer;
l_free(person->text);
- g_free(person->group);
- g_free(person->email);
- g_free(person->sip_uri);
+ l_free(person->group);
+ l_free(person->email);
+ l_free(person->sip_uri);
g_slist_free_full(person->number_list, destroy_number);
@@ -319,7 +319,7 @@ static gboolean need_merge(const char *text)
static void merge_field_generic(char **str1, const char *str2)
{
if ((*str1 == NULL) && (str2 != NULL) && (strlen(str2) != 0))
- *str1 = g_strdup(str2);
+ *str1 = l_strdup(str2);
}
static void merge_field_number(GSList **l, const char *number, int type, char c)
@@ -327,7 +327,7 @@ static void merge_field_number(GSList **l, const char *number, int type, char c)
struct phonebook_number *pn = g_new0(struct phonebook_number, 1);
enum phonebook_number_type category;
- pn->number = g_strdup(number);
+ pn->number = l_strdup(number);
pn->type = type;
switch (tolower(c)) {
case 'w':
@@ -716,7 +716,7 @@ static void radio_settings_unregister(struct ofono_atom *atom)
if (rs->settings) {
storage_close(rs->imsi, SETTINGS_STORE, rs->settings, TRUE);
- g_free(rs->imsi);
+ l_free(rs->imsi);
rs->imsi = NULL;
rs->settings = NULL;
}
@@ -805,7 +805,7 @@ static void radio_load_settings(struct ofono_radio_settings *rs,
return;
}
- rs->imsi = g_strdup(imsi);
+ rs->imsi = l_strdup(imsi);
error = NULL;
rs->band_gsm = g_key_file_get_integer(rs->settings, SETTINGS_GROUP,
@@ -1779,7 +1779,7 @@ static void sms_remove(struct ofono_atom *atom)
storage_close(sms->imsi, SETTINGS_STORE, sms->settings, TRUE);
- g_free(sms->imsi);
+ l_free(sms->imsi);
sms->imsi = NULL;
sms->settings = NULL;
}
@@ -1821,7 +1821,7 @@ static void sms_load_settings(struct ofono_sms *sms, const char *imsi)
if (sms->settings == NULL)
return;
- sms->imsi = g_strdup(imsi);
+ sms->imsi = l_strdup(imsi);
error = NULL;
sms->ref = g_key_file_get_integer(sms->settings, SETTINGS_GROUP,
@@ -132,9 +132,9 @@ struct sms_agent *sms_agent_new(const char *interface,
if (agent == NULL)
return NULL;
- agent->interface = g_strdup(interface);
- agent->service = g_strdup(service);
- agent->path = g_strdup(path);
+ agent->interface = l_strdup(interface);
+ agent->service = l_strdup(service);
+ agent->path = l_strdup(path);
agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, service,
sms_agent_disconnect_cb,
@@ -179,9 +179,9 @@ void sms_agent_free(struct sms_agent *agent)
g_slist_foreach(agent->reqs, sms_agent_request_cancel, NULL);
g_slist_free(agent->reqs);
- g_free(agent->path);
- g_free(agent->service);
- g_free(agent->interface);
+ l_free(agent->path);
+ l_free(agent->service);
+ l_free(agent->interface);
g_free(agent);
}
@@ -161,8 +161,8 @@ void stk_agent_free(struct stk_agent *agent)
if (agent->removed_cb)
agent->removed_cb(agent->removed_data);
- g_free(agent->path);
- g_free(agent->bus);
+ l_free(agent->path);
+ l_free(agent->bus);
g_free(agent);
}
@@ -236,8 +236,8 @@ struct stk_agent *stk_agent_new(const char *path, const char *sender,
if (agent == NULL)
return NULL;
- agent->path = g_strdup(path);
- agent->bus = g_strdup(sender);
+ agent->path = l_strdup(path);
+ agent->bus = l_strdup(sender);
agent->remove_on_terminate = remove_on_terminate;
agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender,
@@ -90,7 +90,7 @@ static struct ssc_entry *ssc_entry_create(const char *sc, void *cb, void *data,
if (r == NULL)
return r;
- r->service = g_strdup(sc);
+ r->service = l_strdup(sc);
r->cb = cb;
r->user = data;
r->destroy = destroy;
@@ -105,7 +105,7 @@ static void ssc_entry_destroy(gpointer pointer)
if (ca->destroy)
ca->destroy(ca->user);
- g_free(ca->service);
+ l_free(ca->service);
g_free(ca);
}
@@ -232,7 +232,7 @@ static gboolean recognized_control_string(struct ofono_ussd *ussd,
const char *ss_str,
DBusMessage *msg)
{
- char *str = g_strdup(ss_str);
+ char *str = l_strdup(ss_str);
char *sc, *sia, *sib, *sic, *sid, *dn;
int type;
gboolean ret = FALSE;
@@ -286,7 +286,7 @@ static gboolean recognized_control_string(struct ofono_ussd *ussd,
*/
out:
- g_free(str);
+ l_free(str);
return ret;
}