From 5546e323550422b8a84e7c1d0b69e11623666cb6 Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Tue, 22 Jun 2004 17:42:14 +0000 Subject: Merge major BSD mutex and symbol conflict patches (bug #1816) (link patch still pending) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@3273 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- sched.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sched.c') diff --git a/sched.c b/sched.c index b8c494015..48417ef71 100755 --- a/sched.c +++ b/sched.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -63,6 +64,7 @@ struct sched_context *sched_context_create(void) struct sched_context *tmp; tmp = malloc(sizeof(struct sched_context)); if (tmp) { + memset(tmp, 0, sizeof(struct sched_context)); ast_mutex_init(&tmp->lock); tmp->eventcnt = 1; tmp->schedcnt = 0; @@ -97,6 +99,7 @@ void sched_context_destroy(struct sched_context *con) } /* And the context */ ast_mutex_unlock(&con->lock); + ast_mutex_destroy(&con->lock); free(con); } -- cgit v1.2.3