[asterisk-commits] file: branch 1.4 r52572 -
/branches/1.4/apps/app_voicemail.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Jan 29 11:59:42 MST 2007
Author: file
Date: Mon Jan 29 12:59:41 2007
New Revision: 52572
URL: http://svn.digium.com/view/asterisk?view=rev&rev=52572
Log:
Use ast_calloc instead of malloc.
Modified:
branches/1.4/apps/app_voicemail.c
Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=52572&r1=52571&r2=52572
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Mon Jan 29 12:59:41 2007
@@ -2511,16 +2511,14 @@
if (!vms_p) {
if(option_debug > 2)
ast_log (LOG_DEBUG,"Adding new vmstate for %s\n",vmu->imapuser);
- vms_p = (struct vm_state *)malloc(sizeof(struct vm_state));
+ if (!(vms_p = ast_calloc(1, sizeof(*vms_p))))
+ return -1;
ast_copy_string(vms_p->imapuser,vmu->imapuser, sizeof(vms_p->imapuser));
ast_copy_string(vms_p->username, mailboxnc, sizeof(vms_p->username)); /* save for access from interactive entry point */
vms_p->mailstream = NIL; /* save for access from interactive entry point */
if(option_debug > 2)
ast_log (LOG_DEBUG,"Copied %s to %s\n",vmu->imapuser,vms_p->imapuser);
- vms_p->quota_limit = 0;
- vms_p->quota_usage = 0;
vms_p->updated = 1;
- vms_p->interactive = 0;
/* set mailbox to INBOX! */
ast_copy_string(vms_p->curbox, mbox(0), sizeof(vms_p->curbox));
init_vm_state(vms_p);
More information about the asterisk-commits
mailing list