summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2021-04-28 16:39:46 +0200
committerMarcel Holtmann <marcel@holtmann.org>2021-04-28 16:39:46 +0200
commitd841e741994f3db2bbdef4a0e1c68542d6ca2887 (patch)
tree694dd14ca2e2d6f0c2b43b229cdbae7570398695 /src
parentdbbbebf92d786b089508b70f87532613a3f76a03 (diff)
downloadofono-d841e741994f3db2bbdef4a0e1c68542d6ca2887.tar.gz
treewide: Replace g_memdup with g_memdup2
Diffstat (limited to 'src')
-rw-r--r--src/modem.c4
-rw-r--r--src/network.c2
-rw-r--r--src/sim.c10
-rw-r--r--src/simfs.c2
-rw-r--r--src/simutil.c2
-rw-r--r--src/smsutil.c6
-rw-r--r--src/voicecall.c2
7 files changed, 14 insertions, 14 deletions
diff --git a/src/modem.c b/src/modem.c
index 52988cf3..bd4c1049 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -1754,10 +1754,10 @@ static int set_modem_property(struct ofono_modem *modem, const char *name,
property->value = g_strdup((const char *) value);
break;
case PROPERTY_TYPE_INTEGER:
- property->value = g_memdup(value, sizeof(int));
+ property->value = g_memdup2(value, sizeof(int));
break;
case PROPERTY_TYPE_BOOLEAN:
- property->value = g_memdup(value, sizeof(ofono_bool_t));
+ property->value = g_memdup2(value, sizeof(ofono_bool_t));
break;
default:
break;
diff --git a/src/network.c b/src/network.c
index 2824eae6..0d54bb35 100644
--- a/src/network.c
+++ b/src/network.c
@@ -733,7 +733,7 @@ static gboolean update_operator_list(struct ofono_netreg *netreg, int total,
/* New operator */
struct network_operator_data *opd;
- opd = g_memdup(copd,
+ opd = g_memdup2(copd,
sizeof(struct network_operator_data));
if (!network_operator_dbus_register(netreg, opd)) {
diff --git a/src/sim.c b/src/sim.c
index 793ff64a..e150c962 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -1182,7 +1182,7 @@ static void sim_iidf_read_cb(int ok, int length, int record,
clut_len = data[3] * 3;
iidf_id = efimg[3] << 8 | efimg[4];
- sim->iidf_image = g_memdup(data, length);
+ sim->iidf_image = g_memdup2(data, length);
/* The path it the same between 2G and 3G */
path_len = sim_ef_db_get_path_3g(SIM_EFIMG_FILEID, path);
@@ -1925,7 +1925,7 @@ static void sim_efsst_read_cb(int ok, int length, int record,
goto out;
}
- sim->efsst = g_memdup(data, length);
+ sim->efsst = g_memdup2(data, length);
sim->efsst_length = length;
/*
@@ -1964,7 +1964,7 @@ static void sim_efest_read_cb(int ok, int length, int record,
goto out;
}
- sim->efest = g_memdup(data, length);
+ sim->efest = g_memdup2(data, length);
sim->efest_length = length;
/*
@@ -2008,7 +2008,7 @@ static void sim_efust_read_cb(int ok, int length, int record,
goto out;
}
- sim->efust = g_memdup(data, length);
+ sim->efust = g_memdup2(data, length);
sim->efust_length = length;
/*
@@ -2151,7 +2151,7 @@ static void sim_efli_read_cb(int ok, int length, int record,
if (!ok)
return;
- sim->efli = g_memdup(data, length);
+ sim->efli = g_memdup2(data, length);
sim->efli_length = length;
}
diff --git a/src/simfs.c b/src/simfs.c
index a42dee3a..8b838b00 100644
--- a/src/simfs.c
+++ b/src/simfs.c
@@ -1128,7 +1128,7 @@ int sim_fs_write(struct ofono_sim_context *context, int id,
op->cb = cb;
op->userdata = userdata;
op->is_read = FALSE;
- op->buffer = g_memdup(data, length);
+ op->buffer = g_memdup2(data, length);
op->structure = structure;
op->length = length;
op->current = record;
diff --git a/src/simutil.c b/src/simutil.c
index acb2aa2f..5d2aa6a2 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -1606,7 +1606,7 @@ GSList *sim_parse_app_template_entries(const unsigned char *buffer, int len)
} else
app.label = NULL;
- ret = g_slist_prepend(ret, g_memdup(&app, sizeof(app)));
+ ret = g_slist_prepend(ret, g_memdup2(&app, sizeof(app)));
len -= (dataobj - buffer) + dataobj_len;
buffer = dataobj + dataobj_len;
diff --git a/src/smsutil.c b/src/smsutil.c
index e6556df6..6911f839 100644
--- a/src/smsutil.c
+++ b/src/smsutil.c
@@ -2814,7 +2814,7 @@ static void sr_assembly_load_backup(GHashTable *assembly_table,
}
/* Node ready, create key and add them to the table */
- id_table_key = g_memdup(msgid, SMS_MSGID_LEN);
+ id_table_key = g_memdup2(msgid, SMS_MSGID_LEN);
g_hash_table_insert(id_table, id_table_key, node);
}
@@ -3129,7 +3129,7 @@ void status_report_assembly_add_fragment(
/* Create node in the message id hashtable if required */
if (node == NULL) {
- id_table_key = g_memdup(msgid, SMS_MSGID_LEN);
+ id_table_key = g_memdup2(msgid, SMS_MSGID_LEN);
node = g_new0(struct id_table_node, 1);
node->total_mrs = total_mrs;
@@ -3240,7 +3240,7 @@ static GSList *sms_tx_load(const char *imsi, const struct dirent *dir)
if (sms_deserialize_outgoing(buf, &s, r) == FALSE)
goto free_pdu;
- list = g_slist_prepend(list, g_memdup(&s, sizeof(s)));
+ list = g_slist_prepend(list, g_memdup2(&s, sizeof(s)));
free_pdu:
g_free(pdus[len]);
diff --git a/src/voicecall.c b/src/voicecall.c
index 93a92544..6265e4dd 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2417,7 +2417,7 @@ void ofono_voicecall_notify(struct ofono_voicecall *vc,
__ofono_modem_callid_hold(modem, call->id);
- newcall = g_memdup(call, sizeof(struct ofono_call));
+ newcall = g_memdup2(call, sizeof(struct ofono_call));
if (newcall == NULL) {
ofono_error("Unable to allocate call");
goto error;