diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-03-09 21:57:37 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-03-09 21:57:37 +0000 |
commit | 82ce59cd0fd65f4d3b13dc4c305fc6d8ec44a12c (patch) | |
tree | 59d060f22217bda52a711dbada1b7c771ddca617 /gdk-pixbuf | |
parent | a1e455446281f6a6a1a4eac14cd064cd9cfa93a7 (diff) | |
download | gtk+-82ce59cd0fd65f4d3b13dc4c305fc6d8ec44a12c.tar.gz |
Remove unnecessary NULL checks before g_free(). (#369666, Morten Welinder,
2007-03-09 Matthias Clasen <mclasen@redhat.com>
* Everywhere: Remove unnecessary NULL checks before
g_free(). (#369666, Morten Welinder, Djihed Afifi)
* configure.in: Check for ftw.h
svn path=/trunk/; revision=17444
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/io-bmp.c | 3 | ||||
-rw-r--r-- | gdk-pixbuf/io-ico.c | 6 | ||||
-rw-r--r-- | gdk-pixbuf/io-pcx.c | 12 | ||||
-rw-r--r-- | gdk-pixbuf/io-png.c | 3 | ||||
-rw-r--r-- | gdk-pixbuf/io-ras.c | 6 | ||||
-rw-r--r-- | gdk-pixbuf/io-tga.c | 9 |
6 files changed, 13 insertions, 26 deletions
diff --git a/gdk-pixbuf/io-bmp.c b/gdk-pixbuf/io-bmp.c index 0e72e599c5..d0347c963a 100644 --- a/gdk-pixbuf/io-bmp.c +++ b/gdk-pixbuf/io-bmp.c @@ -691,8 +691,7 @@ static gboolean gdk_pixbuf__bmp_image_stop_load(gpointer data, GError **error) g_return_val_if_fail(context != NULL, TRUE); - if (context->Colormap != NULL) - g_free(context->Colormap); + g_free(context->Colormap); if (context->pixbuf) g_object_unref(context->pixbuf); diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c index 04dde32141..f25ecec3dc 100644 --- a/gdk-pixbuf/io-ico.c +++ b/gdk-pixbuf/io-ico.c @@ -176,11 +176,9 @@ static gboolean gdk_pixbuf__ico_image_load_increment(gpointer data, static void context_free (struct ico_progressive_state *context) { - if (context->LineBuf != NULL) - g_free (context->LineBuf); + g_free (context->LineBuf); context->LineBuf = NULL; - if (context->HeaderBuf != NULL) - g_free (context->HeaderBuf); + g_free (context->HeaderBuf); if (context->pixbuf) g_object_unref (context->pixbuf); diff --git a/gdk-pixbuf/io-pcx.c b/gdk-pixbuf/io-pcx.c index 019604916d..2fdf1e79b7 100644 --- a/gdk-pixbuf/io-pcx.c +++ b/gdk-pixbuf/io-pcx.c @@ -103,16 +103,12 @@ fill_pcx_context(struct pcx_context *context) static void free_pcx_context(struct pcx_context *context, gboolean unref_pixbuf) { - if(context->header) - g_free(context->header); - if(context->buf) - g_free(context->buf); + g_free(context->header); + g_free(context->buf); if(unref_pixbuf && context->pixbuf) g_object_unref(context->pixbuf); - if(context->line) - g_free(context->line); - if(context->p_data) - g_free(context->p_data); + g_free(context->line); + g_free(context->p_data); g_free(context); } diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c index 13a4c66e69..6e6398bdfe 100644 --- a/gdk-pixbuf/io-png.c +++ b/gdk-pixbuf/io-png.c @@ -283,8 +283,7 @@ gdk_pixbuf__png_image_load (FILE *f, GError **error) } if (setjmp (png_ptr->jmpbuf)) { - if (rows) - g_free (rows); + g_free (rows); if (pixbuf) g_object_unref (pixbuf); diff --git a/gdk-pixbuf/io-ras.c b/gdk-pixbuf/io-ras.c index b03a4fb978..9b8a7d628f 100644 --- a/gdk-pixbuf/io-ras.c +++ b/gdk-pixbuf/io-ras.c @@ -281,10 +281,8 @@ gdk_pixbuf__ras_image_stop_load(gpointer data, GError **error) g_return_val_if_fail(context != NULL, TRUE); - if (context->LineBuf != NULL) - g_free(context->LineBuf); - if (context->HeaderBuf != NULL) - g_free(context->HeaderBuf); + g_free(context->LineBuf); + g_free(context->HeaderBuf); if (context->pixbuf) g_object_unref(context->pixbuf); diff --git a/gdk-pixbuf/io-tga.c b/gdk-pixbuf/io-tga.c index 79c661c01f..963c3a6870 100644 --- a/gdk-pixbuf/io-tga.c +++ b/gdk-pixbuf/io-tga.c @@ -228,8 +228,7 @@ static IOBuffer *io_buffer_free_segment(IOBuffer *buffer, static void io_buffer_free(IOBuffer *buffer) { g_return_if_fail(buffer != NULL); - if (buffer->data) - g_free(buffer->data); + g_free(buffer->data); g_free(buffer); } @@ -943,11 +942,9 @@ static gboolean gdk_pixbuf__tga_stop_load(gpointer data, GError **err) ctx->pbuf->width, ctx->pbuf->height, ctx->udata); } - if (ctx->hdr) - g_free (ctx->hdr); + g_free (ctx->hdr); if (ctx->cmap) { - if (ctx->cmap->cols) - g_free (ctx->cmap->cols); + g_free (ctx->cmap->cols); g_free (ctx->cmap); } if (ctx->pbuf) |