Firmware updater: Fix a race condition

avrdude: Handle OOM with configurable handler
This commit is contained in:
Vojtech Kral 2018-08-07 11:28:39 +02:00 committed by bubnikv
parent bd667aad6e
commit 60a0375ff9
14 changed files with 193 additions and 67 deletions

View file

@ -1135,9 +1135,10 @@ static void buspirate_setup(struct programmer_t *pgm)
{
/* Allocate private data */
if ((pgm->cookie = calloc(1, sizeof(struct pdata))) == 0) {
avrdude_message(MSG_INFO, "%s: buspirate_initpgm(): Out of memory allocating private data\n",
progname);
exit(1);
// avrdude_message(MSG_INFO, "%s: buspirate_initpgm(): Out of memory allocating private data\n",
// progname);
// exit(1);
avrdude_oom("buspirate_initpgm(): Out of memory allocating private data\n");
}
PDATA(pgm)->serial_recv_timeout = 100;
}