patch #7667: Minor memory handling fixes

git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1020 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
rliebscher 2011-12-17 13:45:54 +00:00
parent 7eef860eb1
commit 0efb404152
1 changed files with 6 additions and 1 deletions

View File

@ -636,12 +636,14 @@ prog_parm :
K_USBVID TKN_EQUAL TKN_NUMBER { K_USBVID TKN_EQUAL TKN_NUMBER {
{ {
current_prog->usbvid = $3->value.number; current_prog->usbvid = $3->value.number;
free_token($3);
} }
} | } |
K_USBPID TKN_EQUAL TKN_NUMBER { K_USBPID TKN_EQUAL TKN_NUMBER {
{ {
current_prog->usbpid = $3->value.number; current_prog->usbpid = $3->value.number;
free_token($3);
} }
} | } |
@ -672,6 +674,7 @@ prog_parm :
K_BAUDRATE TKN_EQUAL TKN_NUMBER { K_BAUDRATE TKN_EQUAL TKN_NUMBER {
{ {
current_prog->baudrate = $3->value.number; current_prog->baudrate = $3->value.number;
free_token($3);
} }
} | } |
@ -1292,7 +1295,8 @@ part_parm :
K_MEMORY TKN_STRING K_MEMORY TKN_STRING
{ {
current_mem = avr_new_memtype(); current_mem = avr_new_memtype();
strcpy(current_mem->desc, strdup($2->value.string)); strncpy(current_mem->desc, $2->value.string, AVR_MEMDESCLEN);
current_mem->desc[AVR_MEMDESCLEN-1] = 0;
free_token($2); free_token($2);
} }
mem_specs mem_specs
@ -1458,6 +1462,7 @@ static int assign_pin(int pinno, TOKEN * v, int invert)
int value; int value;
value = v->value.number; value = v->value.number;
free_token(v);
if ((value <= 0) || (value >= 18)) { if ((value <= 0) || (value >= 18)) {
fprintf(stderr, fprintf(stderr,