summaryrefslogtreecommitdiffstats
path: root/libass/ass_bitmap.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2010-08-09 03:28:29 +0200
committerGrigori Goronzy <greg@blackbox>2010-08-09 05:58:00 +0200
commit32083be82b7b533fa85c36ae5ccacea94857fafa (patch)
treeb492d25d52fe7daed512d828aabccaa1eff4352d /libass/ass_bitmap.c
parent65d9960f24ec25cadfacd505046f9e4f2932bb12 (diff)
downloadlibass-32083be82b7b533fa85c36ae5ccacea94857fafa.tar.bz2
libass-32083be82b7b533fa85c36ae5ccacea94857fafa.tar.xz
Get rid of NULL checks for free
The useless "if (foo) free(foo)" idiom is all over the place, just get rid of it finally...
Diffstat (limited to 'libass/ass_bitmap.c')
-rw-r--r--libass/ass_bitmap.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/libass/ass_bitmap.c b/libass/ass_bitmap.c
index 9211a7c..522bce7 100644
--- a/libass/ass_bitmap.c
+++ b/libass/ass_bitmap.c
@@ -113,8 +113,7 @@ static void resize_tmp(ASS_SynthPriv *priv, int w, int h)
priv->tmp_w *= 2;
while (priv->tmp_h < h)
priv->tmp_h *= 2;
- if (priv->tmp)
- free(priv->tmp);
+ free(priv->tmp);
priv->tmp = malloc((priv->tmp_w + 1) * priv->tmp_h * sizeof(short));
}
@@ -127,12 +126,9 @@ ASS_SynthPriv *ass_synth_init(double radius)
void ass_synth_done(ASS_SynthPriv *priv)
{
- if (priv->tmp)
- free(priv->tmp);
- if (priv->g)
- free(priv->g);
- if (priv->gt2)
- free(priv->gt2);
+ free(priv->tmp);
+ free(priv->g);
+ free(priv->gt2);
free(priv);
}
@@ -149,11 +145,9 @@ static Bitmap *alloc_bitmap(int w, int h)
void ass_free_bitmap(Bitmap *bm)
{
- if (bm) {
- if (bm->buffer)
- free(bm->buffer);
- free(bm);
- }
+ if (bm)
+ free(bm->buffer);
+ free(bm);
}
static Bitmap *copy_bitmap(const Bitmap *src)