From 5a34899c9b3f85bcbf4a50ef308f262eb3a63238 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Aug 06 2013 14:40:34 +0000 Subject: fix memory leaks in whiptail --- diff --git a/dialogboxes.c b/dialogboxes.c index 3e6e6e4..3885068 100644 --- a/dialogboxes.c +++ b/dialogboxes.c @@ -376,7 +376,7 @@ int listBox(const char * text, int height, int width, poptContext optCon, *result = NULL; if (answer == cancel) rc = DLG_CANCEL; - if (answer == NULL) + else if (answer == NULL) rc = DLG_ESCAPE; else { i = (long) newtListboxGetCurrent(listBox); @@ -487,7 +487,7 @@ int checkList(const char * text, int height, int width, poptContext optCon, *selections = NULL; if (answer == cancel) rc = DLG_CANCEL; - if (answer == NULL) + else if (answer == NULL) rc = DLG_ESCAPE; else { if (useRadio) { @@ -569,7 +569,7 @@ int messageBox(const char * text, int height, int width, int type, int flags) { answer = newtFormGetCurrent(form); if (answer == no) - return DLG_CANCEL; + rc = DLG_CANCEL; } else { newtDrawForm(form);