KindDragon / vld

Visual Leak Detector for Visual C++ 2008-2015
https://kinddragon.github.io/vld/
GNU Lesser General Public License v2.1
1.01k stars 314 forks source link

False positive for std::string initialized in header #62

Open mattdurak opened 5 years ago

mattdurak commented 5 years ago

Given a sample header as follows:

#pragma once

#include <string>

namespace my_string
{
    const std::string the_string("foobar");
}

VLD is detecting a leak of the allocation of the string.

It appears that the helper CallStack::isCrtStartupFunction needs to also filter out the function initterm (currently it only checks for initterm_e.