mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
res_pjsip_exten_state: Check for vector append failure.
Release reference to publisher if we fail to add it to the vector. Change-Id: I64dff3f481b67b9884f37cadba7a5ccf23d084f3
This commit is contained in:
@@ -729,8 +729,11 @@ static int exten_state_publisher_state_cb(const char *context, const char *exten
|
||||
}
|
||||
|
||||
ao2_ref(publisher, +1);
|
||||
AST_VECTOR_APPEND(&pub_data->pubs, publisher);
|
||||
ast_debug(5, "'%s' will publish exten state\n", publisher->name);
|
||||
if (AST_VECTOR_APPEND(&pub_data->pubs, publisher)) {
|
||||
ao2_ref(publisher, -1);
|
||||
} else {
|
||||
ast_debug(5, "'%s' will publish exten state\n", publisher->name);
|
||||
}
|
||||
}
|
||||
ao2_iterator_destroy(&publisher_iter);
|
||||
|
||||
|
Reference in New Issue
Block a user