summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/srv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/srv.c b/main/srv.c
index ef073a517..cedad7363 100644
--- a/main/srv.c
+++ b/main/srv.c
@@ -209,7 +209,8 @@ int ast_srv_lookup(struct srv_context **context, const char *service, const char
}
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);
*context = NULL;
return -1;