aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_crypto.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-21 22:09:06 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-21 22:09:06 +0000
commit1e6b875c67de180e41374795555dde2859e23783 (patch)
treee352cdb4d3acb3dfdb89cf9a9ff83c30fe90ff94 /res/res_crypto.c
parentffcb98861ad5f7e0f3b246e264e61e2fa991522d (diff)
- conversions to allocation wrappers
- replace malloc/memset with ast_calloc - replace malloc/ast_copy_string with ast_strdup (based on patch from issue #6299) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8410 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_crypto.c')
-rw-r--r--res/res_crypto.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/res/res_crypto.c b/res/res_crypto.c
index 048006f69..aaf6cf809 100644
--- a/res/res_crypto.c
+++ b/res/res_crypto.c
@@ -215,13 +215,10 @@ static struct ast_key *try_load_key (char *dir, char *fname, int ifd, int ofd, i
/* Make fname just be the normal name now */
*c = '\0';
if (!key) {
- key = (struct ast_key *)malloc(sizeof(struct ast_key));
- if (!key) {
- ast_log(LOG_WARNING, "Out of memory\n");
+ if (!(key = ast_calloc(1, sizeof(*key)))) {
fclose(f);
return NULL;
}
- memset(key, 0, sizeof(struct ast_key));
}
/* At this point we have a key structure (old or new). Time to
fill it with what we know */