Fix a crash on reload by using calloc() instead of malloc() to ensure that

data is properly initialized.
(issue #9765, reported by MatsK, patch from eliel)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2007-05-31 14:52:30 +00:00
parent 0b2db74e5a
commit 8ea9dcc221
3 changed files with 195 additions and 7 deletions

View File

@@ -2301,7 +2301,7 @@ static int timezone_add(char *zonename, char *config)
struct minivm_zone *newzone;
char *msg_format, *timezone;
newzone = malloc(sizeof(struct minivm_zone));
newzone = ast_calloc(1, sizeof(struct minivm_zone));
if (newzone == NULL)
return 0;