diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-11 22:41:34 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-11 22:41:34 +0000 |
commit | 9909f9bd4d7afbb49685b706184f22d82505a7ff (patch) | |
tree | d4ab39f3172c244d70ca7bfc20e75bccec31b341 /apps/app_alarmreceiver.c | |
parent | f5498b059fb6138859d37da7f3095ef1a1ee1901 (diff) |
conversions to memory allocation wrappers (issue #6210)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7991 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_alarmreceiver.c')
-rw-r--r-- | apps/app_alarmreceiver.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/apps/app_alarmreceiver.c b/apps/app_alarmreceiver.c index 7c36b60b8..e7310ef23 100644 --- a/apps/app_alarmreceiver.c +++ b/apps/app_alarmreceiver.c @@ -56,6 +56,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/localtime.h" #include "asterisk/callerid.h" #include "asterisk/astdb.h" +#include "asterisk/utils.h" #define ALMRCV_CONFIG "alarmreceiver.conf" #define ADEMCO_CONTACT_ID "ADEMCO_CONTACT_ID" @@ -579,17 +580,11 @@ static int receive_ademco_contact_id( struct ast_channel *chan, void *data, int events_received++; - /* Queue the Event */ - - if((enew = malloc(sizeof(event_node_t))) == NULL){ - if(option_verbose >= 1) - ast_verbose(VERBOSE_PREFIX_1 "AlarmReceiver: Failed to allocate memory\n"); - ast_log(LOG_WARNING, "AlarmReceiver Failed to allocate memory\n"); + /* Queue the Event */ + if (!(enew = ast_calloc(1, sizeof(*enew)))) { res = -1; - break; + break; } - - memset(enew, 0, sizeof(event_node_t)); enew->next = NULL; ast_copy_string(enew->data, event, sizeof(enew->data)); |