From 580159ed979dac6aa792b4f1ced75da25b937595 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 18 Mar 2019 22:11:31 +0100 Subject: [PATCH] mem leak --- client/cmdhflegic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index 8d79e2d2c..7aa93f456 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -614,8 +614,7 @@ int CmdLegicRfWrite(const char *Cmd) { PrintAndLogEx(NORMAL, "############# DANGER ################"); PrintAndLogEx(NORMAL, "# changing the DCF is irreversible #"); PrintAndLogEx(NORMAL, "#####################################"); - char *answer = NULL; - answer = readline("do you really want to continue? y(es) n(o) : "); + char *answer = readline("do you really want to continue? y(es) n(o) : "); bool overwrite = (answer[0] == 'y' || answer[0] == 'Y'); if (!overwrite) { PrintAndLogEx(NORMAL, "command cancelled"); @@ -1283,6 +1282,7 @@ int CmdLegicWipe(const char *Cmd) { } } PrintAndLogEx(SUCCESS, "ok\n"); + free(data); return 0; }