frontend/inp.c, inp_parse_temper(), bug fix, prevent multiple free'ed memory

This commit is contained in:
rlar 2016-03-17 20:35:22 +01:00
parent c9ee5a4501
commit cc8f84ab84
1 changed files with 4 additions and 2 deletions

View File

@ -1469,7 +1469,7 @@ inp_parse_temper(struct line *card)
*str_ptr = ' '; *str_ptr = ' ';
/* create wordlist suitable for com_altermod */ /* 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, paramname);
wl_append_word(&wl, &wlend, copy("=")); wl_append_word(&wl, &wlend, copy("="));
/* to be filled in by evaluation function */ /* to be filled in by evaluation function */
@ -1481,6 +1481,7 @@ inp_parse_temper(struct line *card)
modtlistnew->next = modtlist; modtlistnew->next = modtlist;
modtlist = modtlistnew; modtlist = modtlistnew;
} }
tfree(devmodname);
} else { /* instance expression with 'temper' */ } else { /* instance expression with 'temper' */
struct pt_temper *devtlistnew = NULL; struct pt_temper *devtlistnew = NULL;
/* get device name */ /* get device name */
@ -1518,7 +1519,7 @@ inp_parse_temper(struct line *card)
*str_ptr = ' '; *str_ptr = ' ';
/* create wordlist suitable for com_altermod */ /* 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, paramname);
wl_append_word(&wl, &wlend, copy("=")); wl_append_word(&wl, &wlend, copy("="));
/* to be filled in by evaluation function */ /* to be filled in by evaluation function */
@ -1530,6 +1531,7 @@ inp_parse_temper(struct line *card)
devtlistnew->next = devtlist; devtlistnew->next = devtlist;
devtlist = devtlistnew; devtlist = devtlistnew;
} }
tfree(devmodname);
} }
} }