From 1e6b875c67de180e41374795555dde2859e23783 Mon Sep 17 00:00:00 2001 From: russell Date: Sat, 21 Jan 2006 22:09:06 +0000 Subject: - 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 --- res/res_crypto.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'res/res_crypto.c') 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 */ -- cgit v1.2.3