Merge pull request #6809 from deepikabhavnani/add_assert

Mbed Stats: Assert if NULL pointer passed as arg
pull/6856/head
Cruz Monrreal 2018-05-09 10:50:10 -05:00 committed by GitHub
commit a2370d57fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,7 @@
void mbed_stats_stack_get(mbed_stats_stack_t *stats)
{
MBED_ASSERT(stats != NULL);
memset(stats, 0, sizeof(mbed_stats_stack_t));
#if MBED_STACK_STATS_ENABLED && MBED_CONF_RTOS_PRESENT
@ -38,6 +39,7 @@ void mbed_stats_stack_get(mbed_stats_stack_t *stats)
size_t mbed_stats_stack_get_each(mbed_stats_stack_t *stats, size_t count)
{
MBED_ASSERT(stats != NULL);
memset(stats, 0, count*sizeof(mbed_stats_stack_t));
size_t i = 0;