Fwd: Re: deleting null pointer arrays (was: Re: extragear/network/ktorrent)

Andreas Hartmetz ahartmetz at gmail.com
Sun Jan 18 18:45:44 GMT 2009


On Thursday 15 January 2009 13:36:16 Dominik Haumann wrote:
> Hi,
>
> according to [1] this change is wrong:
> >>         BitSet & BitSet::operator = (const BitSet & bs)
> >>         {
> >> -               if (data)
> >> -                       delete [] data;
> >> +               delete [] data
>
> Still, it seems to be unclear whether that's sill an issue.
> Does anyone have an idea?
>
Heh, as the guy who committed that I feel somewhat guilty. I was aware of a 
certain remaining risk when committing those supposedly safe changes, most 
likely because I may have made a mistake in the process.
This is quite a glaring compiler problem though. I've read most of the KDE 
hints and guidelines some time ago and this one either didn't exist at the 
time or I missed it.




More information about the kde-core-devel mailing list