Context |
Check |
Description |
tedd_an/pre-ci_am |
success
|
Success
|
tedd_an/CheckPatch |
success
|
CheckPatch PASS
|
tedd_an/GitLint |
success
|
Gitlint PASS
|
tedd_an/BuildEll |
success
|
Build ELL PASS
|
tedd_an/BluezMake |
success
|
Bluez Make PASS
|
tedd_an/MakeCheck |
success
|
Bluez Make Check PASS
|
tedd_an/MakeDistcheck |
success
|
Make Distcheck PASS
|
tedd_an/CheckValgrind |
success
|
Check Valgrind PASS
|
tedd_an/CheckSmatch |
success
|
CheckSparse PASS
|
tedd_an/bluezmakeextell |
success
|
Make External ELL PASS
|
tedd_an/IncrementalBuild |
success
|
Incremental Build PASS
|
tedd_an/ScanBuild |
warning
|
ScanBuild: src/shared/gatt-client.c:451:21: warning: Use of memory after it is freed
gatt_db_unregister(op->client->db, op->db_id);
^~~~~~~~~~
src/shared/gatt-client.c:696:2: warning: Use of memory after it is freed
discovery_op_complete(op, false, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:996:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1102:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1296:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1361:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1636:6: warning: Use of memory after it is freed
if (read_db_hash(op)) {
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1641:2: warning: Use of memory after it is freed
discover_all(op);
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:2145:6: warning: Use of memory after it is freed
if (read_db_hash(op)) {
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:2153:8: warning: Use of memory after it is freed
discovery_op_ref(op),
^~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:3242:2: warning: Use of memory after it is freed
complete_write_long_op(req, success, 0, false);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:3264:2: warning: Use of memory after it is freed
request_unref(req);
^~~~~~~~~~~~~~~~~~
12 warnings generated.
|
@@ -2127,14 +2127,8 @@ static void read_vocs_audio_descriptor(struct bt_vcp *vcp, bool success,
return;
}
- vocs_ao_dec_r = malloc(length+1);
- memset(vocs_ao_dec_r, 0, length+1);
- memcpy(vocs_ao_dec_r, value, length);
-
- if (!vocs_ao_dec_r) {
- DBG(vcp, "Unable to get VOCS Audio Descriptor");
- return;
- }
+ vocs_ao_dec_r = util_memdup(value, length + 1);
+ memset(vocs_ao_dec_r + length, 0, 1);
DBG(vcp, "VOCS Audio Descriptor: %s", vocs_ao_dec_r);
free(vocs_ao_dec_r);
@@ -2531,14 +2525,8 @@ static void read_aics_audio_ip_description(struct bt_vcp *vcp, bool success,
return;
}
- ip_descrptn = malloc(length+1);
- memset(ip_descrptn, 0, length+1);
- memcpy(ip_descrptn, value, length);
-
- if (!ip_descrptn) {
- DBG(vcp, "Unable to get Audio Input Description");
- return;
- }
+ ip_descrptn = util_memdup(value, length + 1);
+ memset(ip_descrptn + length, 0, 1);
DBG(vcp, "Audio Input Description: %s", ip_descrptn);
free(ip_descrptn);