[Asterisk-code-review] res stasis.c: Protect channel datastore list from stasis end. (asterisk[13])
Anonymous Coward
asteriskteam at digium.com
Thu Mar 31 00:48:39 CDT 2016
Anonymous Coward #1000019 has submitted this change and it was merged.
Change subject: res_stasis.c: Protect channel datastore list from stasis end.
......................................................................
res_stasis.c: Protect channel datastore list from stasis end.
Change-Id: Ifadc469590bd4d5368e19d3763db3bd1f80fdb95
---
M res/res_stasis.c
1 file changed, 6 insertions(+), 6 deletions(-)
Approvals:
Anonymous Coward #1000019: Verified
Joshua Colp: Looks good to me, approved
George Joseph: Looks good to me, but someone else must approve
diff --git a/res/res_stasis.c b/res/res_stasis.c
index 94b037e..629955e 100644
--- a/res/res_stasis.c
+++ b/res/res_stasis.c
@@ -1188,10 +1188,11 @@
struct ast_datastore *datastore;
datastore = ast_datastore_alloc(&set_end_published_info, NULL);
-
- ast_channel_lock(chan);
- ast_channel_datastore_add(chan, datastore);
- ast_channel_unlock(chan);
+ if (datastore) {
+ ast_channel_lock(chan);
+ ast_channel_datastore_add(chan, datastore);
+ ast_channel_unlock(chan);
+ }
}
int stasis_app_channel_is_stasis_end_published(struct ast_channel *chan)
@@ -1211,12 +1212,11 @@
ast_channel_lock(chan);
datastore = ast_channel_datastore_find(chan, &set_end_published_info, NULL);
- ast_channel_unlock(chan);
-
if (datastore) {
ast_channel_datastore_remove(chan, datastore);
ast_datastore_free(datastore);
}
+ ast_channel_unlock(chan);
}
/*! /brief Stasis dialplan application callback */
--
To view, visit https://gerrit.asterisk.org/2506
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifadc469590bd4d5368e19d3763db3bd1f80fdb95
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
More information about the asterisk-code-review
mailing list