Skip to content
Snippets Groups Projects
Commit 4ca1cdfd authored by Corey Farrell's avatar Corey Farrell
Browse files

test_sorcery_memory_cache_thrash: Handle error from vector append.

Cleanup resources when we fail to append the vector and report test
failure.

Change-Id: I6eb41586fd11dee8c0dfe35e91cb465a4cab7298
parent 457abd06
Branches
Tags
No related merge requests found
...@@ -218,7 +218,11 @@ static struct sorcery_memory_cache_thrash *sorcery_memory_cache_thrash_create(co ...@@ -218,7 +218,11 @@ static struct sorcery_memory_cache_thrash *sorcery_memory_cache_thrash_create(co
/* This purposely holds no ref as the main thrash structure does */ /* This purposely holds no ref as the main thrash structure does */
thread->sorcery = thrash->sorcery; thread->sorcery = thrash->sorcery;
AST_VECTOR_APPEND(&thrash->threads, thread); if (AST_VECTOR_APPEND(&thrash->threads, thread)) {
ast_free(thread);
ao2_ref(thrash, -1);
return NULL;
}
} }
return thrash; return thrash;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment