inpcom.c: remove memory leak

This commit is contained in:
h_vogt 2012-12-01 13:24:46 +01:00
parent b45c4ea78b
commit 6a6c49516a
1 changed files with 3 additions and 1 deletions

View File

@ -3407,7 +3407,9 @@ get_number_terminals(char *c)
i = j = 0; i = j = 0;
/* find the last token in the line*/ /* find the last token in the line*/
while ((i < 100) && (*c != '\0')) { while ((i < 100) && (*c != '\0')) {
strncpy(nam_buf, gettok_instance(&c), 32); char *tmp_inst = gettok_instance(&c);
strncpy(nam_buf, tmp_inst, 32);
tfree(tmp_inst);
if (strchr(nam_buf, '=')) if (strchr(nam_buf, '='))
j++; j++;
i++; i++;