summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/canvas_base.c8
-rw-r--r--common/canvas_utils.c4
-rw-r--r--common/gdi_canvas.c4
-rw-r--r--common/gl_canvas.c4
-rw-r--r--common/lines.c15
-rw-r--r--common/mem.c4
-rw-r--r--common/sw_canvas.c4
7 files changed, 12 insertions, 31 deletions
diff --git a/common/canvas_base.c b/common/canvas_base.c
index d11c8ec0..16688fb3 100644
--- a/common/canvas_base.c
+++ b/common/canvas_base.c
@@ -749,9 +749,7 @@ static pixman_image_t *canvas_get_lz(CanvasBase *canvas, SpiceImage *image, int
int free_palette;
if (setjmp(lz_data->jmp_env)) {
- if (decomp_buf) {
- free(decomp_buf);
- }
+ free(decomp_buf);
CANVAS_ERROR("lz error, %s", lz_data->message_buf);
}
@@ -3134,9 +3132,7 @@ static void canvas_draw_stroke(SpiceCanvas *spice_canvas, SpiceRect *bbox,
stroke_lines_draw(&lines, (lineGC *)&gc, dashed);
- if (gc.base.dash) {
- free(gc.base.dash);
- }
+ free(gc.base.dash);
stroke_lines_free(&lines);
if (!gc.solid && gc.tile && !surface_canvas) {
diff --git a/common/canvas_utils.c b/common/canvas_utils.c
index 55b71599..71f6890e 100644
--- a/common/canvas_utils.c
+++ b/common/canvas_utils.c
@@ -51,9 +51,7 @@ static void release_data(pixman_image_t *image, void *release_data)
gdi_handlers--;
}
#endif
- if (data->data) {
- free(data->data);
- }
+ free(data->data);
free(data);
}
diff --git a/common/gdi_canvas.c b/common/gdi_canvas.c
index 1a46ac1a..5c9cdf01 100644
--- a/common/gdi_canvas.c
+++ b/common/gdi_canvas.c
@@ -1773,9 +1773,7 @@ static void gdi_canvas_draw_stroke(SpiceCanvas *spice_canvas, SpiceRect *bbox, S
}
#endif
- if (user_style) {
- free(user_style);
- }
+ free(user_style);
}
static void gdi_canvas_clear(SpiceCanvas *spice_canvas)
diff --git a/common/gl_canvas.c b/common/gl_canvas.c
index a04740b3..ffc6b52d 100644
--- a/common/gl_canvas.c
+++ b/common/gl_canvas.c
@@ -870,9 +870,7 @@ static void gl_canvas_destroy(SpiceCanvas *spice_canvas)
}
canvas_base_destroy(&canvas->base);
glc_destroy(canvas->glc, canvas->textures_lost);
- if (canvas->private_data) {
- free(canvas->private_data);
- }
+ free(canvas->private_data);
free(canvas);
}
diff --git a/common/lines.c b/common/lines.c
index e2349e82..9b47ee38 100644
--- a/common/lines.c
+++ b/common/lines.c
@@ -580,8 +580,7 @@ miAppendSpans (SpanGroup * spanGroup, SpanGroup * otherGroup, Spans * spans)
static void
miFreeSpanGroup (SpanGroup * spanGroup)
{
- if (spanGroup->group != NULL)
- xfree (spanGroup->group);
+ xfree (spanGroup->group);
}
static void
@@ -776,10 +775,8 @@ miFillUniqueSpanGroup (GCPtr pGC, SpanGroup * spanGroup, Boolean foreground)
ysizes = (int *)xalloc (ylength * sizeof (int));
if (!yspans || !ysizes) {
- if (yspans)
- xfree (yspans);
- if (ysizes)
- xfree (ysizes);
+ xfree (yspans);
+ xfree (ysizes);
miDisposeSpanGroup (spanGroup);
return;
}
@@ -849,10 +846,8 @@ miFillUniqueSpanGroup (GCPtr pGC, SpanGroup * spanGroup, Boolean foreground)
}
xfree (yspans);
xfree (ysizes);
- if (points)
- xfree (points);
- if (widths)
- xfree (widths);
+ xfree (points);
+ xfree (widths);
return;
}
count = 0;
diff --git a/common/mem.c b/common/mem.c
index 7236cf0c..5298e37d 100644
--- a/common/mem.c
+++ b/common/mem.c
@@ -130,9 +130,7 @@ void *spice_realloc(void *mem, size_t n_bytes)
(unsigned long)n_bytes);
}
- if (mem) {
- free(mem);
- }
+ free(mem);
return NULL;
}
diff --git a/common/sw_canvas.c b/common/sw_canvas.c
index 02934174..8eabc896 100644
--- a/common/sw_canvas.c
+++ b/common/sw_canvas.c
@@ -1166,9 +1166,7 @@ static void canvas_destroy(SpiceCanvas *spice_canvas)
}
pixman_image_unref(canvas->image);
canvas_base_destroy(&canvas->base);
- if (canvas->private_data) {
- free(canvas->private_data);
- }
+ free(canvas->private_data);
free(canvas);
}