Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7084 closed Bugs (fixed)

memory leak in fileiter.cpp

Reported by: Gaurav Gupta <g.gupta@…> Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc: yogen.saini@…

Description

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.

Attachments (1)

fileiter.cpp_patch (366 bytes ) - added by Gaurav Gupta <g.gupta@…> 10 years ago.
Fix for the reported Bug.

Download all attachments as: .zip

Change History (3)

by Gaurav Gupta <g.gupta@…>, 10 years ago

Attachment: fileiter.cpp_patch added

Fix for the reported Bug.

comment:1 by John Maddock, 10 years ago

Resolution: fixed
Status: newclosed

(In [79338]) Fix potential memory leak. Fixes #7084.

comment:2 by John Maddock, 10 years ago

(In [79556]) Merge collected bug fixes from Trunk: Refs #589. Refs #7032. Refs #7084. Refs #6346.

Note: See TracTickets for help on using tickets.