aboutsummaryrefslogtreecommitdiff
path: root/src/param.c
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-03-13 19:22:39 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-03-13 19:22:39 +0300
commitac5114fdf74099a8ce8b9c154231e226e6883b94 (patch)
treee4224c1c37507366896470ce4e8e3467e8e407af /src/param.c
parent8f1e6faa7f548c9a8bcbcac71c8f239a6540b926 (diff)
downloadmagi-ac5114fdf74099a8ce8b9c154231e226e6883b94.tar
magi-ac5114fdf74099a8ce8b9c154231e226e6883b94.tar.xz
magi-ac5114fdf74099a8ce8b9c154231e226e6883b94.zip
[magi]
Diffstat (limited to 'src/param.c')
-rw-r--r--src/param.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/param.c b/src/param.c
index dd89a48..9c94555 100644
--- a/src/param.c
+++ b/src/param.c
@@ -19,6 +19,9 @@ void magi_params_set(magi_params **params, magi_param *newitem)
if (!*params) {
magi_params_add(params, newitem);
} else if (!strcmp((*params)->item.name, newitem->name)) {
+ free((*params)->item.name);
+ free((*params)->item.data);
+ (*params)->item.name = newitem->name;
(*params)->item.data = newitem->data;
} else {
magi_params_set(&(*params)->next, newitem);