Skip to content
Snippets Groups Projects
Commit 0e941a8d authored by Kevin P. Fleming's avatar Kevin P. Fleming
Browse files

fix thinko in dnsmgr.c (lesson: don't commit while you are rushing to a...

fix thinko in dnsmgr.c (lesson: don't commit while you are rushing to a meeting and then heading out of town...)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 11056078
No related branches found
No related tags found
No related merge requests found
......@@ -86,13 +86,13 @@ struct ast_dnsmgr_entry *ast_dnsmgr_get(const char *name, struct in_addr *result
void ast_dnsmgr_release(struct ast_dnsmgr_entry *entry)
{
/* if there is an entry (and not the special flag value), remove/free it */
if (entry && (entry != (typeof(entry)) -1)) {
AST_LIST_LOCK(&entry_list);
AST_LIST_REMOVE(&entry_list, entry, list);
AST_LIST_UNLOCK(&entry_list);
free(entry);
};
if (!entry)
return;
AST_LIST_LOCK(&entry_list);
AST_LIST_REMOVE(&entry_list, entry, list);
AST_LIST_UNLOCK(&entry_list);
free(entry);
}
int ast_dnsmgr_lookup(const char *name, struct in_addr *result, struct ast_dnsmgr_entry **dnsmgr)
......@@ -119,15 +119,13 @@ int ast_dnsmgr_lookup(const char *name, struct in_addr *result, struct ast_dnsmg
if ((hp = ast_gethostbyname(name, &ahp)))
memcpy(result, hp->h_addr, sizeof(result));
/* flag value to indicate no manager was allocated */
*dnsmgr = (typeof(*dnsmgr)) -1;
return 0;
} else {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_2 "adding manager for '%s'\n", name);
*dnsmgr = ast_dnsmgr_get(name, result);
return !*dnsmgr;
}
return !*dnsmgr;
}
static void *do_refresh(void *data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment