From 9619bff6858d3d94e9375841925ca5072abc5dca Mon Sep 17 00:00:00 2001 From: Aron Podrigal Date: Mon, 21 Nov 2016 23:08:16 +0000 Subject: [PATCH] FS-9758: switch_sql_queue_manager_destroy() avoid null pointer deref If passed in *qmp is a null pointer return `SWITCH_STATUS_NOOP` --- src/switch_core_sqldb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c index a9dbe889b1..b323c85e41 100644 --- a/src/switch_core_sqldb.c +++ b/src/switch_core_sqldb.c @@ -1710,6 +1710,11 @@ SWITCH_DECLARE(switch_status_t) switch_sql_queue_manager_destroy(switch_sql_queu switch_assert(qmp); qm = *qmp; + if (!qm) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No SQL queue to destroy.\n"); + return SWITCH_STATUS_NOOP; + } + *qmp = NULL; switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s Destroying SQL queue.\n", qm->name);