]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Stasis: Fix potential memory leak of control data. 70/2070/1
authorMark Michelson <mmichelson@digium.com>
Fri, 22 Jan 2016 21:08:58 +0000 (15:08 -0600)
committerMark Michelson <mmichelson@digium.com>
Fri, 22 Jan 2016 21:08:58 +0000 (15:08 -0600)
commit1003c2eb0505c34c6fe3ebd587fe3adf413b979a
tree89cbb80fcc67ffee98157b1ff1a34f5804c72fd3
parent1c95b211a0416c0d9ee0a732fe5615a356e7c12f
Stasis: Fix potential memory leak of control data.

When queuing tasks onto the Stasis control queue, you can pass an
arbitrary data pointer and a function to free that data. All ARI
commands that use the Stasis control queue made the assumption that the
destructor function would be called in all paths, whether the task was
queued successfully or not. However, this was not correct. If a task was
queued onto a control structure that was already completed, the
allocated data would not be freed properly.

This patch corrects this by making sure that all return paths call the
data destructor.

Change-Id: Ibf06522094f8e5c4cce652537dc5d7222b1c4fcb
res/stasis/control.c