diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-06 21:20:11 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-06 21:20:11 +0000 |
commit | eb5d461ed4688cafadc76bebf329a2fae454dc12 (patch) | |
tree | 5503cb153c9de46c07e3a0a521cc996926ed375b /main/event.c | |
parent | 125558c76fd4870a9133e4974cce6410c89a3593 (diff) |
Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67864 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/event.c')
-rw-r--r-- | main/event.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/main/event.c b/main/event.c index ffa2912b0..905790614 100644 --- a/main/event.c +++ b/main/event.c @@ -109,9 +109,9 @@ static AST_RWLIST_HEAD(ast_event_ref_list, ast_event_ref) ast_event_cache[AST_EV static void ast_event_ie_val_destroy(struct ast_event_ie_val *ie_val) { if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_STR) - free((void *) ie_val->payload.str); + ast_free((void *) ie_val->payload.str); - free(ie_val); + ast_free(ie_val); } enum ast_event_subscriber_res ast_event_check_subscriber(enum ast_event_type type, ...) @@ -270,7 +270,7 @@ struct ast_event_sub *ast_event_subscribe(enum ast_event_type type, ast_event_cb ie_val->payload.uint = va_arg(ap, uint32_t); else if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_STR) { if (!(ie_val->payload.str = ast_strdup(va_arg(ap, const char *)))) { - free(ie_val); + ast_free(ie_val); continue; } } @@ -327,7 +327,7 @@ static void ast_event_sub_destroy(struct ast_event_sub *sub) while ((ie_val = AST_LIST_REMOVE_HEAD(&sub->ie_vals, entry))) ast_event_ie_val_destroy(ie_val); - free(sub); + ast_free(sub); } void ast_event_unsubscribe(struct ast_event_sub *sub) @@ -481,13 +481,13 @@ struct ast_event *ast_event_new(enum ast_event_type type, ...) void ast_event_destroy(struct ast_event *event) { - free(event); + ast_free(event); } static void ast_event_ref_destroy(struct ast_event_ref *event_ref) { ast_event_destroy(event_ref->event); - free(event_ref); + ast_free(event_ref); } static struct ast_event *ast_event_dup(const struct ast_event *event) |