mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-20 18:40:31 +00:00
fix common realloc mistake
This commit is contained in:
parent
cc7fb27297
commit
1ba1a8829a
@ -105,7 +105,9 @@ int attribute_value_buffer_size = 1000;
|
||||
void assertBuffer(int size){
|
||||
if (size > attribute_value_buffer_size){
|
||||
attribute_value_buffer_size *= 2;
|
||||
attribute_value = (uint8_t *) realloc(attribute_value, attribute_value_buffer_size);
|
||||
uint8_t * new_attribute = (uint8_t *) realloc(attribute_value, attribute_value_buffer_size);
|
||||
if (!new_attribute) return;
|
||||
attribute_value = new_attribute;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,9 @@ int attribute_value_buffer_size = 1000;
|
||||
void assertBuffer(int size){
|
||||
if (size > attribute_value_buffer_size){
|
||||
attribute_value_buffer_size *= 2;
|
||||
attribute_value = (uint8_t *) realloc(attribute_value, attribute_value_buffer_size);
|
||||
uint8_t * new_attribute = (uint8_t *) realloc(attribute_value, attribute_value_buffer_size);
|
||||
if (!new_attribute) return;
|
||||
attribute_value = new_attribute;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user