summaryrefslogtreecommitdiff
path: root/main/event.c
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2007-06-06 21:20:11 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2007-06-06 21:20:11 +0000
commit9d05ff8ed5f2c898370896ff7a8bb67885596ba1 (patch)
tree5503cb153c9de46c07e3a0a521cc996926ed375b /main/event.c
parent033a3df22aa68f04327066e0567b76f73c437651 (diff)
Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/event.c')
-rw-r--r--main/event.c12
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)