]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
fix memory leaks in whiptail
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 6 Aug 2013 14:40:34 +0000 (16:40 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 6 Aug 2013 14:40:34 +0000 (16:40 +0200)
dialogboxes.c

index 3e6e6e485b311a6a63bf1c2efafe585b0bf91b84..3885068f4c697f13f2ffbab62611f30ab653b07c 100644 (file)
@@ -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);