diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-11 18:40:42 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-11 18:40:42 +0000 |
commit | 1e9f9a21275e2c861b3269910e8c99555f8d1e2c (patch) | |
tree | 7ec55b6c6aa3160e04fc629881e136c5ed76ffe9 /apps/app_adsiprog.c | |
parent | d9d4aadd30b94412a18040fd4c146ec84395d90c (diff) |
replace malloc+memset with a call to ast_calloc, also removing the error
message that is no longer necessary (issue #6205)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7985 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_adsiprog.c')
-rw-r--r-- | apps/app_adsiprog.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/apps/app_adsiprog.c b/apps/app_adsiprog.c index 59fc26eab..0f3b157c3 100644 --- a/apps/app_adsiprog.c +++ b/apps/app_adsiprog.c @@ -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)) { |