replace malloc+memset with a call to ast_calloc, also removing the error
authorRussell Bryant <russell@russellbryant.com>
Wed, 11 Jan 2006 18:40:42 +0000 (18:40 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 11 Jan 2006 18:40:42 +0000 (18:40 +0000)
message that is no longer necessary (issue #6205)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7985 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_adsiprog.c

index 59fc26e..0f3b157 100644 (file)
@@ -1359,13 +1359,10 @@ static struct adsi_script *compile_script(char *script)
                ast_log(LOG_WARNING, "Can't open file '%s'\n", fn);
                return NULL;
        }
-       scr = malloc(sizeof(struct adsi_script));
-       if (!scr) {
+       if (!(scr = ast_calloc(1, sizeof(*scr)))) {
                fclose(f);
-               ast_log(LOG_WARNING, "Out of memory loading script '%s'\n", fn);
                return NULL;
        }
-       memset(scr, 0, sizeof(struct adsi_script));
        /* Create "main" as first subroutine */
        getsubbyname(scr, "main", NULL, 0);
        while(!feof(f)) {