mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-06 04:30:28 +00:00
Merge "srv: Fix crash when ast_srv_lookup is used and 0 records are returned."
This commit is contained in:
@@ -209,7 +209,8 @@ int ast_srv_lookup(struct srv_context **context, const char *service, const char
|
|||||||
}
|
}
|
||||||
AST_LIST_HEAD_INIT_NOLOCK(&(*context)->entries);
|
AST_LIST_HEAD_INIT_NOLOCK(&(*context)->entries);
|
||||||
|
|
||||||
if ((ast_search_dns(*context, service, C_IN, T_SRV, srv_callback)) < 0) {
|
if (((ast_search_dns(*context, service, C_IN, T_SRV, srv_callback)) < 1) ||
|
||||||
|
AST_LIST_EMPTY(&(*context)->entries)) {
|
||||||
ast_free(*context);
|
ast_free(*context);
|
||||||
*context = NULL;
|
*context = NULL;
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user