1
0
mirror of https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git synced 2026-07-29 10:55:50 +00:00

avrdude: Fix serial port handle leak in many places

This commit is contained in:
Vojtech Kral
2019-02-27 16:32:17 +01:00
parent a61a72cc94
commit b7941345d1
5 changed files with 38 additions and 12 deletions
+3 -1
View File
@@ -192,8 +192,10 @@ static int wiring_open(PROGRAMMER * pgm, char * port)
/* drain any extraneous input */
stk500v2_drain(pgm, 0);
if (stk500v2_getsync(pgm) < 0)
if (stk500v2_getsync(pgm) < 0) {
serial_close(&pgm->fd);
return -1;
}
return 0;
}