Skip to content

Commit

Permalink
mgos_conf_set_str(): Check is the valus is the same
Browse files Browse the repository at this point in the history
If it is, don't free it and do nothing.
  • Loading branch information
rojer committed Sep 13, 2021
1 parent 9da5cb8 commit fe168af
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/mgos_config_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ void mgos_conf_free(const struct mgos_conf_entry *schema, void *cfg) {
}

void mgos_conf_set_str(const char **vp, const char *v) {
if (*vp == v) return;
mgos_conf_free_str(vp);
mgos_conf_copy_str(v, vp);
}
Expand Down

0 comments on commit fe168af

Please sign in to comment.