]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9758: switch_sql_queue_manager_destroy() avoid null pointer deref
authorAron Podrigal <aronp@guaranteedplus.com>
Mon, 21 Nov 2016 23:08:16 +0000 (23:08 +0000)
committerAron Podrigal <aronp@guaranteedplus.com>
Mon, 21 Nov 2016 23:08:16 +0000 (23:08 +0000)
If passed in *qmp is a null pointer return `SWITCH_STATUS_NOOP`

src/switch_core_sqldb.c

index a9dbe889b15ffba486543321c9fd32dd3f990a5b..b323c85e41beb09a284c7041beb9e75d9cc0cc93 100644 (file)
@@ -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);