]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Unit-Tests] Tweak test framework, fail loading unit test when out of memory. 866/head
authorMike Jerris <mike@signalwire.com>
Tue, 22 Sep 2020 18:24:45 +0000 (22:24 +0400)
committerAndrey Volk <andywolk@gmail.com>
Tue, 22 Sep 2020 18:56:54 +0000 (22:56 +0400)
src/include/test/switch_fct.h

index ab70d882c5e0eee55672b4aa19effb92b26d8df2..a9b3595d0e8d3845886f86d5a2fa2bada4009849 100644 (file)
@@ -743,6 +743,7 @@ fct_nlist__final(fct_nlist_t *list, fct_nlist_on_del_t on_del)
     FCT_ASSERT( list != NULL );
     fct_nlist__clear(list, on_del);
     free(list->itm_list);
+    list->itm_list = NULL;
 }
 
 
@@ -2193,12 +2194,14 @@ should be directly from the program's main. */
 static int
 fctkern__init(fctkern_t *nk, int argc, const char *argv[])
 {
+    int ok = 0;
     if ( argc == 0 && argv == NULL )
     {
         return 0;
     }
     memset(nk, 0, sizeof(fctkern_t));
-    fct_clp__init(&(nk->cl_parser), NULL);
+    ok = fct_clp__init(&(nk->cl_parser), NULL);
+    if (!ok) return ok;
     fct_nlist__init(&(nk->logger_list));
     nk->lt_usr = NULL;  /* Supplied via 'install' mechanics. */
     nk->lt_sys = FCT_LOGGER_TYPES;