tpaviot/oce — Issue #246: Incorrect code changes for "new" delete edits
Author: pdolbey
Created: 2012-02-01 22:45:20+00:00
State: open

Sorry guys, I know there's been an excercise to clean up some of the possible memory leaks by adding some "delete []" operations, but it looks to have caused some possible logic bombs.

I just started an update to my oce environment following a git pull and started getting a bunch of errors complaining about unreachacble code. The first was from OSD_FontMgr.cxx

At line 166 I see the fragment

if( !strcpy( font_dir, windir_var ) )
delete [] windir_var;
delete [] font_dir;
return ;

which previouisly looked like (I guess)

if( !strcpy( font_dir, windir_var ) )
return ;

I would say that some braces are missing - in my style of coding I would expect

if( !strcpy( font_dir, windir_var ) )
{
delete [] windir_var;
delete [] font_dir;
return ;
}

Now if I was really clever I'd know how to branch and fix all these little logic bombs, but I'm not fully conversant with git and the oce workflow yet so hope some of you guys can help out with this and similar oopses.

Pete