Fix malloc size for file path
We need 4 more characters to store the suffix.
This commit is contained in:
parent
4e6fbae45c
commit
e0d8ef20fa
@ -452,7 +452,7 @@ void dynsec__config_save(void)
|
||||
|
||||
/* Save to file */
|
||||
file_path_len = strlen(config_file) + 1;
|
||||
file_path = mosquitto_malloc(file_path_len);
|
||||
file_path = mosquitto_malloc(file_path_len + 4);
|
||||
if(file_path == NULL){
|
||||
mosquitto_free(json_str);
|
||||
mosquitto_log_printf(MOSQ_LOG_ERR, "Error saving Dynamic security plugin config: Out of memory.\n");
|
||||
|
Loading…
Reference in New Issue
Block a user