api: use malloc for rx thread arg instead of heap 02/27002/6
authorFlorin Coras <fcoras@cisco.com>
Mon, 11 May 2020 18:03:40 +0000 (18:03 +0000)
committerDave Barach <openvpp@barachs.net>
Tue, 12 May 2020 14:16:57 +0000 (14:16 +0000)
Type: fix

Avoids issues if thread with non-zero __os_thread_index attaches to
binary api.

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ib981f12c867fdee7590391ec43128145bb1abce6

src/vlibmemory/memory_client.c

index c6bfb6f..64650b6 100644 (file)
@@ -63,7 +63,7 @@ rx_thread_fn (void *arg)
 
   vlibapi_set_main (a->am);
   vlibapi_set_memory_client_main (a->mm);
-  clib_mem_free (a);
+  free (a);
 
   mm = vlibapi_get_memory_client_main ();
   q = vlibapi_get_main ()->vl_input_queue;
@@ -428,7 +428,7 @@ connect_to_vlib_internal (const char *svm_name,
       if (thread_fn == rx_thread_fn)
        {
          rx_thread_fn_arg_t *arg;
-         arg = clib_mem_alloc (sizeof (*arg));
+         arg = malloc (sizeof (*arg));
          arg->am = vlibapi_get_main ();
          arg->mm = vlibapi_get_memory_client_main ();
          thread_fn_arg = (void *) arg;