@@ -294,14 +294,12 @@ _distanceBits = distanceBits; _dictionaryBits = dictionaryBits; _slidingWindowMask = (1 << dictionaryBits) - 1; - _slidingWindow = [self allocMemoryWithSize: + _slidingWindow = [self allocZeroedMemoryWithSize: _slidingWindowMask + 1]; - /* Avoid leaking data */ - memset(_slidingWindow, 0, _slidingWindowMask + 1); } @catch (id e) { [self release]; @throw e; } @@ -358,12 +356,11 @@ goto start; } _codesCount = bits; _codesReceived = 0; - _codesLengths = [self allocMemoryWithSize: bits]; - memset(_codesLengths, 0, bits); + _codesLengths = [self allocZeroedMemoryWithSize: bits]; _skip = true; _state = STATE_CODE_LEN_TREE; goto start; case STATE_CODE_LEN_TREE: @@ -439,12 +436,11 @@ goto start; } _codesCount = bits; _codesReceived = 0; - _codesLengths = [self allocMemoryWithSize: bits]; - memset(_codesLengths, 0, bits); + _codesLengths = [self allocZeroedMemoryWithSize: bits]; _skip = false; _treeIter = _codeLenTree; _state = STATE_LITLEN_TREE; goto start; @@ -529,12 +525,11 @@ goto start; } _codesCount = bits; _codesReceived = 0; - _codesLengths = [self allocMemoryWithSize: bits]; - memset(_codesLengths, 0, bits); + _codesLengths = [self allocZeroedMemoryWithSize: bits]; _treeIter = _codeLenTree; _state = STATE_DIST_TREE; goto start; case STATE_DIST_TREE: