[Boost-bugs] [Boost C++ Libraries] #7084: memory leak in fileiter.cpp

Subject: [Boost-bugs] [Boost C++ Libraries] #7084: memory leak in fileiter.cpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-07-05 12:07:02


#7084: memory leak in fileiter.cpp
------------------------------------------------+---------------------------
 Reporter: Gaurav Gupta <g.gupta@…> | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: regex
  Version: Boost 1.51.0 | Severity: Problem
 Keywords: |
------------------------------------------------+---------------------------
 In file libs/regex/src/fileiter.cpp

 In case the opendir is successful but if condition fails in following code
 block then there will be memory leak.

 {{{
 DIR* h = opendir(dat->root);
    dat->d = h;
    if(h != 0)
    {
       if(_fi_FindNextFile(dat, lpFindFileData))
          return dat;
    }
    delete dat;
    return 0;
 }}}

 The attached patch is the fix for this situation.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7084>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC