@@ -38615,6 +38615,7 @@ static int x25519_nonblock_test(WC_RNG* rng)
3861538615 ret = wc_curve25519_set_nonblock(&userA, &nbCtx);
3861638616 if (ret != 0) {
3861738617 printf("wc_curve25519_set_nonblock 1 %d\n", ret);
38618+ wc_curve25519_free(&userA);
3861838619 return -10723;
3861938620 }
3862038621 count = 0;
@@ -38624,6 +38625,7 @@ static int x25519_nonblock_test(WC_RNG* rng)
3862438625 } while (ret == FP_WOULDBLOCK);
3862538626 if (ret != 0) {
3862638627 printf("wc_curve25519_make_key_nb 1 %d\n", ret);
38628+ wc_curve25519_free(&userA);
3862738629 return -10724;
3862838630 }
3862938631#if defined(DEBUG_WOLFSSL) || defined(WOLFSSL_DEBUG_NONBLOCK)
@@ -38640,6 +38642,8 @@ static int x25519_nonblock_test(WC_RNG* rng)
3864038642 ret = wc_curve25519_set_nonblock(&userB, &nbCtx);
3864138643 if (ret != 0) {
3864238644 printf("wc_curve25519_set_nonblock 2 %d\n", ret);
38645+ wc_curve25519_free(&userA);
38646+ wc_curve25519_free(&userB);
3864338647 return -10725;
3864438648 }
3864538649 count = 0;
@@ -38649,6 +38653,8 @@ static int x25519_nonblock_test(WC_RNG* rng)
3864938653 } while (ret == FP_WOULDBLOCK);
3865038654 if (ret != 0) {
3865138655 printf("wc_curve25519_make_key_nb 2 %d\n", ret);
38656+ wc_curve25519_free(&userA);
38657+ wc_curve25519_free(&userB);
3865238658 return -10726;
3865338659 }
3865438660
@@ -38659,6 +38665,8 @@ static int x25519_nonblock_test(WC_RNG* rng)
3865938665 } while (ret == FP_WOULDBLOCK);
3866038666 if (ret != 0) {
3866138667 printf("wc_curve25519_shared_secret_nb 1 %d\n", ret);
38668+ wc_curve25519_free(&userA);
38669+ wc_curve25519_free(&userB);
3866238670 return -10727;
3866338671 }
3866438672
@@ -38671,6 +38679,8 @@ static int x25519_nonblock_test(WC_RNG* rng)
3867138679 while (ret == FP_WOULDBLOCK);
3867238680 if (ret != 0) {
3867338681 printf("wc_curve25519_shared_secret_nb 2 %d\n", ret);
38682+ wc_curve25519_free(&userA);
38683+ wc_curve25519_free(&userB);
3867438684 return -10728;
3867538685 }
3867638686#if defined(DEBUG_WOLFSSL) || defined(WOLFSSL_DEBUG_NONBLOCK)
@@ -38680,10 +38690,14 @@ static int x25519_nonblock_test(WC_RNG* rng)
3868038690
3868138691 /* compare shared secret keys to test they are the same */
3868238692 if (y != x) {
38693+ wc_curve25519_free(&userA);
38694+ wc_curve25519_free(&userB);
3868338695 return -10729;
3868438696 }
3868538697
3868638698 if (XMEMCMP(sharedA, sharedB, x) != 0) {
38699+ wc_curve25519_free(&userA);
38700+ wc_curve25519_free(&userB);
3868738701 return -10730;
3868838702 }
3868938703#endif /* HAVE_CURVE25519_SHARED_SECRET */
0 commit comments