fix(nimble): Address few coverity reported issues

1. Overflowed constant (INTEGER_OVERFLOW): Added change to typecast
value
2. Structurally dead code: Removed dead code
3. Resource leak: Added a free for allocated memory, in case of failure
4. too_few_printf_args: Corrected print statement to pass arguments
5. Fixed nesting levels
6. Fixed unused value warnings
7. Illegal memory access fix
This commit is contained in:
Rahul Tank 2024-12-02 11:17:46 +05:30
parent c28509987c
commit 8163aa8496
3 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,7 @@ struct pkt_queue *pkt_queue_create(void)
}
if (osi_mutex_new(&queue->lock) != 0) {
osi_free(queue);
return NULL;
}
struct pkt_queue_header *p = &queue->header;
STAILQ_INIT(p);

@ -1 +1 @@
Subproject commit 4cf7d046d3b8e3a572224abe25b8d93a40658ca2
Subproject commit 16d59c062d498b7db210d9dc57255ac5d1d945ad

View File

@ -227,6 +227,7 @@ static esp_err_t set_config_endpoint(void *config, const char *endpoint_name, ui
realloc(ble_config->nu_lookup, (ble_config->nu_lookup_count + 1) * sizeof(protocomm_ble_name_uuid_t)));
if (!lookup_table) {
ESP_LOGE(TAG, "Error allocating memory for EP-UUID lookup table");
free(copy_ep_name);
return ESP_ERR_NO_MEM;
}