From: Aron Podrigal Date: Mon, 21 Nov 2016 23:08:16 +0000 (+0000) Subject: FS-9758: switch_sql_queue_manager_destroy() avoid null pointer deref X-Git-Tag: v1.8.0~1043^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9619bff6858d3d94e9375841925ca5072abc5dca;p=thirdparty%2Ffreeswitch.git FS-9758: switch_sql_queue_manager_destroy() avoid null pointer deref If passed in *qmp is a null pointer return `SWITCH_STATUS_NOOP` --- 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);