summaryrefslogtreecommitdiff
path: root/res/res_crypto.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-01-21 22:09:06 +0000
committerRussell Bryant <russell@russellbryant.com>2006-01-21 22:09:06 +0000
commitefae38a82d88ff964b2d35ebf0895f4cea8ab322 (patch)
treee352cdb4d3acb3dfdb89cf9a9ff83c30fe90ff94 /res/res_crypto.c
parent039ee896c7715c92cbd56a0353afca6a912b05ec (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: https://origsvn.digium.com/svn/asterisk/trunk@8410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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 */