X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/cda2a4c0a5e9b9e2a373aeb822111237ff9ec710..3a532acfe14cf8be11f1f4b26685acbef33a6595:/client/uart.c?ds=sidebyside

diff --git a/client/uart.c b/client/uart.c
index f7c5e35c..e3a6a57b 100644
--- a/client/uart.c
+++ b/client/uart.c
@@ -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)) {