From cc8f84ab8492a13b21d217d997547aa76c2c85d1 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 17 Mar 2016 20:35:22 +0100 Subject: [PATCH] frontend/inp.c, inp_parse_temper(), bug fix, prevent multiple free'ed memory --- src/frontend/inp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index ec45f4626..f620a3188 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -1469,7 +1469,7 @@ inp_parse_temper(struct line *card) *str_ptr = ' '; /* create wordlist suitable for com_altermod */ - wl_append_word(&wl, &wlend, devmodname); + wl_append_word(&wl, &wlend, copy(devmodname)); wl_append_word(&wl, &wlend, paramname); wl_append_word(&wl, &wlend, copy("=")); /* to be filled in by evaluation function */ @@ -1481,6 +1481,7 @@ inp_parse_temper(struct line *card) modtlistnew->next = modtlist; modtlist = modtlistnew; } + tfree(devmodname); } else { /* instance expression with 'temper' */ struct pt_temper *devtlistnew = NULL; /* get device name */ @@ -1518,7 +1519,7 @@ inp_parse_temper(struct line *card) *str_ptr = ' '; /* create wordlist suitable for com_altermod */ - wl_append_word(&wl, &wlend, devmodname); + wl_append_word(&wl, &wlend, copy(devmodname)); wl_append_word(&wl, &wlend, paramname); wl_append_word(&wl, &wlend, copy("=")); /* to be filled in by evaluation function */ @@ -1530,6 +1531,7 @@ inp_parse_temper(struct line *card) devtlistnew->next = devtlist; devtlist = devtlistnew; } + tfree(devmodname); } }