From 956f69ffdb39e9ceea2d2d43162a832ca1c1f18c Mon Sep 17 00:00:00 2001 From: David Ochsner Date: Sat, 23 Sep 2023 10:59:10 +0200 Subject: [PATCH] Remove dangling pointer dereference The destructor of RedisQtAdapter will be called _AFTER_ the context has been freed. At this point, m_ctx is a dangling pointer and should not be dereferenced. --- adapters/qt.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/adapters/qt.h b/adapters/qt.h index 5cc02e6ce..34f56e503 100644 --- a/adapters/qt.h +++ b/adapters/qt.h @@ -72,12 +72,6 @@ class RedisQtAdapter : public QObject { RedisQtAdapter(QObject * parent = 0) : QObject(parent), m_ctx(0), m_read(0), m_write(0) { } - ~RedisQtAdapter() { - if (m_ctx != 0) { - m_ctx->ev.data = NULL; - } - } - int setContext(redisAsyncContext * ac) { if (ac->ev.data != NULL) { return REDIS_ERR;