[SERVER-30141] Coverity analysis defect 101805: Non-virtual destructor Created: 14/Jul/17  Updated: 30/Oct/23  Resolved: 18/Jul/17

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.5.11

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2017-07-31
Participants:

 Description   

The correct derived class destructor is not invoked due to the absence of a virtual destructor in the base class

Defect 101805 (STATIC_C)
Checker VIRTUAL_DTOR (subcategory none)
File: /src/mongo/db/modules/enterprise/src/watchdog/watchdog.h
Function mongo::DirectoryCheck::~DirectoryCheck()
/src/mongo/db/modules/enterprise/src/watchdog/watchdog.h, line: 62
Class "mongo::DirectoryCheck" has a destructor and a pointer to it is upcast to class "mongo::WatchdogCheck" which doesn't have a virtual destructor.

    class DirectoryCheck : public WatchdogCheck {



 Comments   
Comment by Githook User [ 18/Jul/17 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-30141 Coverity analysis defect 101805: Non-virtual destructor
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/2e21daa57cd69563f69cfb3d9b89d505b33d17b9

Generated at Thu Feb 08 04:22:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.