Skip to content

Commit

Permalink
Clearer len calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Apr 1, 2023
1 parent ec6a56d commit 1195dd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/dynamic-security/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,8 @@ void dynsec__config_save(void)
json_str_len = strlen(json_str);

/* Save to file */
file_path_len = strlen(config_file) + 1;
file_path = mosquitto_malloc(file_path_len + 4);
file_path_len = strlen(config_file) + strlen(".new") + 1;
file_path = mosquitto_malloc(file_path_len);
if(file_path == NULL){
mosquitto_free(json_str);
mosquitto_log_printf(MOSQ_LOG_ERR, "Error saving Dynamic security plugin config: Out of memory.\n");
Expand Down

0 comments on commit 1195dd9

Please sign in to comment.