diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-11-07 17:32:48 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-11-07 17:32:48 -0600 |
commit | 250d905fc3e5174d42e7f5c93b6ef1b021aabc1b (patch) | |
tree | 95377f9befdb22fb89435e2cecadc2e3d8a598e1 | |
parent | 2dcd0c8a0590db948cc0fa528f9ea3c6d0f69fa5 (diff) | |
parent | 24b9751aaa2a7cea40ab282acd91bccda19152a7 (diff) |
Merge "test_sorcery_memory_cache_thrash: Handle error from vector append."
-rw-r--r-- | tests/test_sorcery_memory_cache_thrash.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_sorcery_memory_cache_thrash.c b/tests/test_sorcery_memory_cache_thrash.c index c0d25feb3..dfe7a7c81 100644 --- a/tests/test_sorcery_memory_cache_thrash.c +++ b/tests/test_sorcery_memory_cache_thrash.c @@ -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 */ 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; |