]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Use ast_calloc instead of malloc.
authorJoshua Colp <jcolp@digium.com>
Mon, 29 Jan 2007 18:59:41 +0000 (18:59 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 29 Jan 2007 18:59:41 +0000 (18:59 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@52572 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index e95e59c6d2a0f748b6a0dac71d9da5d42e219872..bb2a0fbb2d0673988048b1dc46f71d63ffd5536c 100644 (file)
@@ -2511,16 +2511,14 @@ static int inboxcount(const char *mailbox, int *newmsgs, int *oldmsgs)
        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);