diff options
author | Russell Bryant <russell@russellbryant.com> | 2006-02-09 16:59:50 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2006-02-09 16:59:50 +0000 |
commit | b96af335d8e719bce4032f538a677035f57df949 (patch) | |
tree | bc582fc8d1412250a1a150dcaf06bfb7fe76e0c2 /dnsmgr.c | |
parent | 091a14754d7da5b7a7dddfc356e80ca70d6a678a (diff) |
conversions to memory allocation wrappers, remove duplicated error messages,
remove unnecessary casts, malloc+memset to calloc (issue #6395)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9310 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'dnsmgr.c')
-rw-r--r-- | dnsmgr.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -83,11 +83,7 @@ struct ast_dnsmgr_entry *ast_dnsmgr_get(const char *name, struct in_addr *result { struct ast_dnsmgr_entry *entry; - if (!result || ast_strlen_zero(name)) - return NULL; - - entry = calloc(1, sizeof(*entry) + strlen(name)); - if (!entry) + if (!result || ast_strlen_zero(name) || !(entry = ast_calloc(1, sizeof(*entry) + strlen(name)))) return NULL; entry->result = result; @@ -285,8 +281,7 @@ static struct ast_cli_entry cli_status = { int dnsmgr_init(void) { - sched = sched_context_create(); - if (!sched) { + if (!(sched = sched_context_create())) { ast_log(LOG_ERROR, "Unable to create schedule context.\n"); return -1; } |