mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-09-27 14:50:55 +02:00
fix leak in log_printf
This commit is contained in:
@@ -481,7 +481,7 @@ int log_printf(const char *format, ...)
|
|||||||
vsnprintf(temp, len+1, format, arg);
|
vsnprintf(temp, len+1, format, arg);
|
||||||
#if !CONFIG_DISABLE_HAL_LOCKS
|
#if !CONFIG_DISABLE_HAL_LOCKS
|
||||||
if(_uart_bus_array[s_uart_debug_nr].lock){
|
if(_uart_bus_array[s_uart_debug_nr].lock){
|
||||||
while (xSemaphoreTake(_uart_bus_array[s_uart_debug_nr].lock, portMAX_DELAY) != pdPASS);
|
xSemaphoreTake(_uart_bus_array[s_uart_debug_nr].lock, portMAX_DELAY);
|
||||||
ets_printf("%s", temp);
|
ets_printf("%s", temp);
|
||||||
xSemaphoreGive(_uart_bus_array[s_uart_debug_nr].lock);
|
xSemaphoreGive(_uart_bus_array[s_uart_debug_nr].lock);
|
||||||
} else {
|
} else {
|
||||||
@@ -491,7 +491,7 @@ int log_printf(const char *format, ...)
|
|||||||
ets_printf("%s", temp);
|
ets_printf("%s", temp);
|
||||||
#endif
|
#endif
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
if(len > sizeof(loc_buf)){
|
if(len >= sizeof(loc_buf)){
|
||||||
free(temp);
|
free(temp);
|
||||||
}
|
}
|
||||||
return len;
|
return len;
|
||||||
|
Reference in New Issue
Block a user