From ce072469888db55316d648918229f2b83fc5e7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 11 Dec 2007 16:17:11 +0100 Subject: Don't use the if(foo) free(foo); construct, as free(NULL); is well defined. --- src/libxinevdec/rgb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/libxinevdec/rgb.c') diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 0e7be4c18..803e4fb3a 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -140,8 +140,7 @@ static void rgb_decode_data (video_decoder_t *this_gen, this->bytes_per_pixel = (this->bit_depth + 1) / 8; - if (this->buf) - free (this->buf); + free (this->buf); /* minimal buffer size */ this->bufsize = this->width * this->height * this->bytes_per_pixel; @@ -381,10 +380,7 @@ static void rgb_discontinuity (video_decoder_t *this_gen) { static void rgb_dispose (video_decoder_t *this_gen) { rgb_decoder_t *this = (rgb_decoder_t *) this_gen; - if (this->buf) { - free (this->buf); - this->buf = NULL; - } + free (this->buf); if (this->decoder_ok) { this->decoder_ok = 0; -- cgit v1.2.3