]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/uart.c
ADD: Added the HitagS from @spenneb ref:https://events.ccc.de/congress/2015/Fahrplan...
[proxmark3-svn] / client / uart.c
index f7c5e35c3b0d7ad0a04c950c0ab55d328712933b..e3a6a57b7b68f16e77fb095ee3a79d2ee64fec5b 100644 (file)
@@ -73,6 +73,7 @@ serial_port uart_open(const char* pcPortName)
   // Does the system allows us to place a lock on this file descriptor
   if (fcntl(sp->fd, F_SETLK, &fl) == -1) {
     // A conflicting lock is held by another process
+    free(sp);
     return CLAIMED_SERIAL_PORT;
   }
 
@@ -369,9 +370,9 @@ serial_port uart_open(const char* pcPortName) {
   memset(&sp->dcb, 0, sizeof(DCB));
   sp->dcb.DCBlength = sizeof(DCB);
   if(!BuildCommDCBA("baud=9600 data=8 parity=N stop=1",&sp->dcb)) {
-    uart_close(sp);
-    return INVALID_SERIAL_PORT;
-  }
+               uart_close(sp);
+               return INVALID_SERIAL_PORT;
+       }
   
   // Update the active serial port
   if(!SetCommState(sp->hPort,&sp->dcb)) {
Impressum, Datenschutz