patch #9819: Address several leaks in SVN rev 1429

Submitted by Adrian Klieber



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1435 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch
2020-03-14 22:34:45 +00:00
parent c34fb88844
commit 785b0cea55
7 changed files with 24 additions and 1 deletions

View File

@@ -217,6 +217,7 @@ TOKEN * hexnumber(char * text)
tkn->value.number = strtoul(text, &e, 16);
if ((e == text) || (*e != 0)) {
yyerror("can't scan hex number \"%s\"", text);
free_token(tkn);
return NULL;
}
@@ -244,6 +245,7 @@ TOKEN * string(char * text)
tkn->value.string = (char *) malloc(len+1);
if (tkn->value.string == NULL) {
yyerror("string(): out of memory");
free_token(tkn);
return NULL;
}
strcpy(tkn->value.string, text);