From: Miroslav Lichvar Date: Tue, 6 Aug 2013 14:40:34 +0000 (+0200) Subject: fix memory leaks in whiptail X-Git-Tag: r0-52-16~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a34899c9b3f85bcbf4a50ef308f262eb3a63238;p=thirdparty%2Fnewt.git 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);