[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: extragear/network/ktorrent
From: Dominik Haumann <dhdev () gmx ! de>
Date: 2009-01-13 16:41:25
Message-ID: 200901131741.26042.dhdev () gmx ! de
[Download RAW message or body]
On Tuesday 06 January 2009, Andreas Hartmetz wrote:
> --- trunk/extragear/network/ktorrent/libbtcore/util/bitset.cpp
> #906635:906636 @@ -94,8 +94,7 @@
>
> BitSet & BitSet::operator = (const BitSet & bs)
> {
> - if (data)
> - delete [] data;
> + delete [] data;
> num_bytes = bs.num_bytes;
> num_bits = bs.num_bits;
> data = new Uint8[num_bytes];
...and while we are at it: operator= should check whether &bs == this.
Otherwise you delete data and then access invalid memory. ;)
Dominik
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic