Merge pull request #836 from dgarske/stack_check_free

Fix leak in StackSizeCheck and build error with debug enabled
This commit is contained in:
toddouska
2017-04-07 09:35:01 -07:00
committed by GitHub
3 changed files with 6 additions and 2 deletions

View File

@@ -250,7 +250,8 @@ void bench_rng(void);
double current_time(int); double current_time(int);
#endif #endif
#if defined(DEBUG_WOLFSSL) && !defined(HAVE_VALGRIND) #if defined(DEBUG_WOLFSSL) && !defined(HAVE_VALGRIND) && \
!defined(HAVE_STACK_SIZE)
WOLFSSL_API int wolfSSL_Debugging_ON(); WOLFSSL_API int wolfSSL_Debugging_ON();
#endif #endif

View File

@@ -293,7 +293,8 @@ int mutex_test(void);
int memcb_test(void); int memcb_test(void);
#endif #endif
#if defined(DEBUG_WOLFSSL) && !defined(HAVE_VALGRIND) && !defined(OPENSSL_EXTRA) #if defined(DEBUG_WOLFSSL) && !defined(HAVE_VALGRIND) && \
!defined(OPENSSL_EXTRA) && !defined(HAVE_STACK_SIZE)
int wolfSSL_Debugging_ON(void); int wolfSSL_Debugging_ON(void);
#endif #endif

View File

@@ -1424,6 +1424,8 @@ static INLINE int StackSizeCheck(func_args* args, thread_func tf)
} }
} }
free(myStack);
used = stackSize - i; used = stackSize - i;
printf("stack used = %d\n", used); printf("stack used = %d\n", used);