aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-27 21:00:47 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-27 21:00:47 +0000
commit3e3a3d6e3c6edc683f29ce75cb3be5bda7f31838 (patch)
tree751264385cb81c4f2d036b973577d8e59f62cc83 /apps
parentb42e5047ac37715eed633eb467818fa41b589974 (diff)
Port revisions 124661 and 123650 from trunk to 1.6.0
Thanks to Atis Lezdins for pointing this out on the asterisk-dev mailing list git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@126023 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r--apps/app_queue.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index dd4750640..a30f7de1b 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -3015,11 +3015,18 @@ struct queue_transfer_ds {
int starttime;
};
+static void queue_transfer_destroy(void *data)
+{
+ struct queue_transfer_ds *qtds = data;
+ ast_free(qtds);
+}
+
/*! \brief a datastore used to help correctly log attended transfers of queue callers
*/
static const struct ast_datastore_info queue_transfer_info = {
.type = "queue_transfer",
.chan_fixup = queue_transfer_fixup,
+ .destroy = queue_transfer_destroy,
};
/*! \brief Log an attended transfer when a queue caller channel is masqueraded
@@ -3067,7 +3074,12 @@ static int attended_transfer_occurred(struct ast_channel *chan)
static void setup_transfer_datastore(struct queue_ent *qe, struct member *member, int starttime)
{
struct ast_datastore *ds;
- struct queue_transfer_ds qtds;
+ struct queue_transfer_ds *qtds = ast_calloc(1, sizeof(*qtds));
+
+ if (!qtds) {
+ ast_log(LOG_WARNING, "Memory allocation error!\n");
+ return;
+ }
ast_channel_lock(qe->chan);
if (!(ds = ast_channel_datastore_alloc(&queue_transfer_info, NULL))) {
@@ -3076,11 +3088,11 @@ static void setup_transfer_datastore(struct queue_ent *qe, struct member *member
return;
}
- qtds.qe = qe;
+ qtds->qe = qe;
/* This member is refcounted in try_calling, so no need to add it here, too */
- qtds.member = member;
- qtds.starttime = starttime;
- ds->data = &qtds;
+ qtds->member = member;
+ qtds->starttime = starttime;
+ ds->data = qtds;
ast_channel_datastore_add(qe->chan, ds);
ast_channel_unlock(qe->chan);
}