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
changes/76/7076/1
Corey Farrell 9 years ago
parent 637b37fb98
commit 8684219f79

@ -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);

Loading…
Cancel
Save