Coverity fixes

Signed-off-by: Felipe Contreras <felipe.contreras@nokia.com>
This commit is contained in:
Felipe Contreras
2011-04-28 20:43:21 +03:00
committed by David Schleef
parent c2593cc1bd
commit 6c8d740c1a
4 changed files with 27 additions and 15 deletions

View File

@@ -259,7 +259,7 @@ void FLAC__MD5Final(FLAC__byte digest[16], FLAC__MD5Context *ctx)
byteSwap(ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
if(0 != ctx->internal_buf) {
free(ctx->internal_buf);
ctx->internal_buf = 0;
@@ -408,7 +408,8 @@ FLAC__bool FLAC__MD5Accumulate(FLAC__MD5Context *ctx, const FLAC__int32 * const
if(0 == (ctx->internal_buf = (FLAC__byte*)safe_malloc_(bytes_needed)))
return false;
}
ctx->internal_buf = tmp;
else
ctx->internal_buf = tmp;
ctx->capacity = bytes_needed;
}