[Asterisk-code-review] taskprocessor.c: add NULL check for tps->listener (asterisk[16])

lvl asteriskteam at digium.com
Wed Apr 15 06:50:49 CDT 2020


lvl has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14214 )


Change subject: taskprocessor.c: add NULL check for tps->listener
......................................................................

taskprocessor.c: add NULL check for tps->listener

Change-Id: I43f6e09cb6fbe3aa3b596107c9b281ebf42104fa
---
M main/taskprocessor.c
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/14/14214/1

diff --git a/main/taskprocessor.c b/main/taskprocessor.c
index 52cc5e0..9b137fb 100644
--- a/main/taskprocessor.c
+++ b/main/taskprocessor.c
@@ -1168,6 +1168,12 @@
 	/* The currently executing task counts as still in queue */
 	was_empty = tps->executing ? 0 : previous_size == 0;
 	ao2_unlock(tps);
+
+	if (!tps->listener) {
+		ast_log(LOG_ERROR, "tps listener is NULL!\n");
+		return -1;
+	}
+
 	tps->listener->callbacks->task_pushed(tps->listener, was_empty);
 	return 0;
 }

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14214
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I43f6e09cb6fbe3aa3b596107c9b281ebf42104fa
Gerrit-Change-Number: 14214
Gerrit-PatchSet: 1
Gerrit-Owner: lvl <digium at lvlconsultancy.nl>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200415/901acb68/attachment.html>


More information about the asterisk-code-review mailing list