]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/pair_content.c
ncurses 6.3 - patch 20220529
[ncurses.git] / test / pair_content.c
index adbd08299d2aa1c0101bc5e4ae1643e985918e29..c0e0e71d62e15b3b999bc1b67430cc797aff85bd 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: pair_content.c,v 1.15 2022/04/16 18:27:24 tom Exp $
+ * $Id: pair_content.c,v 1.17 2022/05/28 20:15:06 tom Exp $
  */
 
 #define NEED_TIME_H
@@ -62,13 +62,20 @@ static struct timeval initial_time;
 static struct timeval finish_time;
 #endif
 
+static GCC_NORETURN void
+finish(int code)
+{
+    free(expected);
+    ExitProgram(code);
+}
+
 static void
 failed(const char *msg)
 {
     printw("%s", msg);
     getch();
     endwin();
-    ExitProgram(EXIT_FAILURE);
+    finish(EXIT_FAILURE);
 }
 
 #if USE_EXTENDED_COLOR
@@ -231,7 +238,7 @@ usage(void)
     size_t n;
     for (n = 0; n < SIZEOF(msg); n++)
        fprintf(stderr, "%s\n", msg[n]);
-    ExitProgram(EXIT_FAILURE);
+    finish(EXIT_FAILURE);
 }
 
 int
@@ -314,5 +321,5 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
        finish_test();
     }
 
-    ExitProgram(EXIT_SUCCESS);
+    finish(EXIT_SUCCESS);
 }