X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/87b28d31a1ab21d97e2b9589e2392fc7c6a31599..e579e76873746afc2e0b38a787d626e06184b4bf:/client/proxmark3.c

diff --git a/client/proxmark3.c b/client/proxmark3.c
index 83b58247..907f5e7f 100644
--- a/client/proxmark3.c
+++ b/client/proxmark3.c
@@ -166,7 +166,6 @@ static void *main_loop(void *targ) {
 				if (ret == 99) 
 					break;
 			}
-			free(cmd);
 		} else {
 			printf("\n");
 			break;
@@ -174,7 +173,9 @@ static void *main_loop(void *targ) {
 	}
   
 	write_history(".history");
-  
+
+	free(cmd);
+			
 	if (arg->usb_present == 1) {
 		rarg.run = 0;
 		pthread_join(reader_thread, NULL);
@@ -277,6 +278,6 @@ int main(int argc, char* argv[]) {
   
 	// clean up mutex
 	pthread_mutex_destroy(&print_lock);
-  
+	
 	exit(0);
 }