From 3eac9b5420a59c1dfd619f7672d295e42b78a995 Mon Sep 17 00:00:00 2001 From: Mike Gorse Date: Thu, 30 Dec 2010 06:40:18 -0500 Subject: [PATCH] Fix atspi_rect_copy and atspi_point_copy --- atspi/atspi-component.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/atspi/atspi-component.c b/atspi/atspi-component.c index 1f2bf55..31298bd 100644 --- a/atspi/atspi-component.c +++ b/atspi/atspi-component.c @@ -39,10 +39,14 @@ AtspiRect * atspi_rect_copy (AtspiRect *src) { AtspiRect *dst = g_new (AtspiRect, 1); - dst->x = src->x; - dst->y = src->y; - dst->height = src->height; - dst->width = src->width; + if (dst) + { + dst->x = src->x; + dst->y = src->y; + dst->height = src->height; + dst->width = src->width; + } + return dst; } G_DEFINE_BOXED_TYPE (AtspiRect, atspi_rect, atspi_rect_copy, atspi_rect_free) @@ -51,8 +55,12 @@ AtspiPoint * atspi_point_copy (AtspiPoint *src) { AtspiPoint *dst = g_new (AtspiPoint, 1); - dst->x = src->x; - dst->y = src->y; + if (dst) + { + dst->x = src->x; + dst->y = src->y; + } + return dst; } G_DEFINE_BOXED_TYPE (AtspiPoint, atspi_point, atspi_point_copy, g_free) -- 2.7.4