summaryrefslogtreecommitdiff
path: root/hw/kdrive
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2010-06-10 04:08:54 +0700
committerMikhail Gusarov <dottedmag@dottedmag.net>2010-06-11 19:05:46 +0700
commitf4190feb25ecc3d8278decc8bf28a5ef0e568942 (patch)
tree1bda33d8d65126f4a7d2a53f6efdb69e4a426e1d /hw/kdrive
parent89bd05106e5823fc5cfca9abf082729f2444363b (diff)
Remove more superfluous if(p) checks around free(p)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Diffstat (limited to 'hw/kdrive')
-rw-r--r--hw/kdrive/ephyr/ephyrhostvideo.c6
-rw-r--r--hw/kdrive/ephyr/hostx.c25
2 files changed, 10 insertions, 21 deletions
diff --git a/hw/kdrive/ephyr/ephyrhostvideo.c b/hw/kdrive/ephyr/ephyrhostvideo.c
index 38927b02d..9dde768c8 100644
--- a/hw/kdrive/ephyr/ephyrhostvideo.c
+++ b/hw/kdrive/ephyr/ephyrhostvideo.c
@@ -831,10 +831,8 @@ out:
XFreeGC (dpy, gc) ;
gc = NULL ;
}
- if (rects) {
- free (rects) ;
- rects = NULL ;
- }
+ free(rects);
+ rects = NULL;
EPHYR_LOG ("leave\n") ;
return is_ok ;
}
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 38ee06d25..2ebeca958 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -669,11 +669,8 @@ hostx_screen_init (EphyrScreenInfo screen,
}
else
{
- if (host_screen->ximg->data)
- {
- free(host_screen->ximg->data);
- host_screen->ximg->data = NULL;
- }
+ free(host_screen->ximg->data);
+ host_screen->ximg->data = NULL;
XDestroyImage(host_screen->ximg);
}
@@ -1160,10 +1157,8 @@ out:
XFree (visuals) ;
visuals = NULL;
}
- if (host_visuals) {
- free (host_visuals) ;
- host_visuals = NULL;
- }
+ free(host_visuals);
+ host_visuals = NULL;
EPHYR_LOG ("leave\n") ;
return is_ok ;
@@ -1292,10 +1287,8 @@ hostx_set_window_bounding_rectangles (int a_window,
rects, a_num_rects, ShapeSet, YXBanded) ;
is_ok = TRUE ;
- if (rects) {
- free (rects) ;
- rects = NULL ;
- }
+ free(rects);
+ rects = NULL;
EPHYR_LOG ("leave\n") ;
return is_ok;
}
@@ -1329,10 +1322,8 @@ hostx_set_window_clipping_rectangles (int a_window,
rects, a_num_rects, ShapeSet, YXBanded) ;
is_ok = TRUE ;
- if (rects) {
- free (rects) ;
- rects = NULL ;
- }
+ free(rects);
+ rects = NULL;
EPHYR_LOG ("leave\n") ;
return is_ok;
}