summaryrefslogtreecommitdiffstats
path: root/common/sw_canvas.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2011-12-12 17:53:04 +0000
committerAlon Levy <alevy@redhat.com>2012-01-13 18:11:58 +0200
commitfaf0947ebbcdbd2088d6349e936a23b24d09153b (patch)
treebd3376100183cb58cbf9351a12efd7e47a7e423a /common/sw_canvas.c
parent64f4826b6d6918b81d336f8c4296dc6094067f64 (diff)
downloadspice-faf0947ebbcdbd2088d6349e936a23b24d09153b.tar.gz
spice-faf0947ebbcdbd2088d6349e936a23b24d09153b.tar.xz
spice-faf0947ebbcdbd2088d6349e936a23b24d09153b.zip
Remove useless if() before free()
The free() function allows NULL to be passed in, so any code which puts a if() before free() is wasting time
Diffstat (limited to 'common/sw_canvas.c')
-rw-r--r--common/sw_canvas.c4
1 files changed, 1 insertions, 3 deletions
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);
}