mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
- 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
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user