@@ -334,8 +334,10 @@ int test_wc_Chacha_Process_Chunking(void)
334334 0x0c , 0xb3 , 0xc9 , 0x39 , 0x0f , 0x1f , 0x51 , 0x9d
335335 };
336336
337- WC_ALLOC_VAR (plain , byte , CHACHA_LEN , NULL );
338- WC_ALLOC_VAR (cipher , byte , CHACHA_LEN , NULL );
337+ WC_ALLOC_VAR_EX (plain , byte , CHACHA_LEN , NULL , DYNAMIC_TYPE_TMP_BUFFER ,
338+ ExpectNotNull (plain ); goto cleanup );
339+ WC_ALLOC_VAR_EX (cipher , byte , CHACHA_LEN , NULL , DYNAMIC_TYPE_TMP_BUFFER ,
340+ ExpectNotNull (cipher ); goto cleanup );
339341
340342 XMEMSET (plain , 0xa5 , CHACHA_LEN );
341343 for (i = 0 ; i < (int )sizeof (key ); i ++ ) {
@@ -360,8 +362,11 @@ int test_wc_Chacha_Process_Chunking(void)
360362 ExpectBufEQ (cipher , expected , (int )sizeof (expected ));
361363 }
362364
363- WC_FREE_VAR (plain , NULL );
364- WC_FREE_VAR (cipher , NULL );
365+ #ifdef WC_DECLARE_VAR_IS_HEAP_ALLOC
366+ cleanup :
367+ #endif
368+ WC_FREE_VAR_EX (plain , NULL , DYNAMIC_TYPE_TMP_BUFFER );
369+ WC_FREE_VAR_EX (cipher , NULL , DYNAMIC_TYPE_TMP_BUFFER );
365370#endif
366371 return EXPECT_RESULT ();
367372} /* END test_wc_Chacha_Process */
0 commit comments