diff --git a/src/jtag3.c b/src/jtag3.c index 9d6d5604..0c04426a 100644 --- a/src/jtag3.c +++ b/src/jtag3.c @@ -430,6 +430,7 @@ int jtag3_send(PROGRAMMER * pgm, unsigned char * data, size_t len) if (serial_send(&pgm->fd, buf, len + 4) != 0) { avrdude_message(MSG_INFO, "%s: jtag3_send(): failed to send command to serial port\n", progname); + free(buf); return -1; } diff --git a/src/jtagmkI.c b/src/jtagmkI.c index fc5f3f70..2d4d83cd 100644 --- a/src/jtagmkI.c +++ b/src/jtagmkI.c @@ -214,6 +214,7 @@ static int jtagmkI_send(PROGRAMMER * pgm, unsigned char * data, size_t len) if (serial_send(&pgm->fd, buf, len + 2) != 0) { avrdude_message(MSG_INFO, "%s: jtagmkI_send(): failed to send command to serial port\n", progname); + free(buf); return -1; }