From bdb3231bee7a729a94045133fc4335226b2b0bb9 Mon Sep 17 00:00:00 2001 From: 251 <13120787+251Labs@users.noreply.github.com> Date: Fri, 29 Dec 2017 16:20:28 +0100 Subject: [PATCH] Implements a virtual destructor on the BaseRequestHandler class. Implements a virtual destructor on the BaseRequestHandler class to protect against undefined behavior in the event that a derived BaseRequestHandler class has a destructor and an object of such derived class is destroyed through a pointer to its base class. --- src/bitcoin-cli.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 136981b70..1fe93180f 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -198,6 +198,7 @@ static void http_error_cb(enum evhttp_request_error err, void *ctx) class BaseRequestHandler { public: + virtual ~BaseRequestHandler() {} virtual UniValue PrepareRequest(const std::string& method, const std::vector& args) = 0; virtual UniValue ProcessReply(const UniValue &batch_in) = 0; };