mirror of
https://github.com/claunia/flac.git
synced 2025-12-16 18:54:26 +00:00
zero allocated class memory
This commit is contained in:
@@ -146,17 +146,23 @@ FLAC__StreamDecoder *FLAC__stream_decoder_new()
|
||||
if(decoder == 0) {
|
||||
return 0;
|
||||
}
|
||||
memset(decoder, 0, sizeof(FLAC__StreamDecoder));
|
||||
|
||||
decoder->protected_ = (FLAC__StreamDecoderProtected*)malloc(sizeof(FLAC__StreamDecoderProtected));
|
||||
if(decoder->protected_ == 0) {
|
||||
free(decoder);
|
||||
return 0;
|
||||
}
|
||||
memset(decoder->protected_, 0, sizeof(FLAC__StreamDecoderProtected));
|
||||
|
||||
decoder->private_ = (FLAC__StreamDecoderPrivate*)malloc(sizeof(FLAC__StreamDecoderPrivate));
|
||||
if(decoder->private_ == 0) {
|
||||
free(decoder->protected_);
|
||||
free(decoder);
|
||||
return 0;
|
||||
}
|
||||
memset(decoder->private_, 0, sizeof(FLAC__StreamDecoderPrivate));
|
||||
|
||||
decoder->private_->input = FLAC__bitbuffer_new();
|
||||
if(decoder->private_->input == 0) {
|
||||
free(decoder->private_);
|
||||
|
||||
Reference in New Issue
Block a user