[at-spi2-core] Fix atspi_rect_copy and atspi_point_copy
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Fix atspi_rect_copy and atspi_point_copy
- Date: Thu, 30 Dec 2010 11:37:46 +0000 (UTC)
commit 3eac9b5420a59c1dfd619f7672d295e42b78a995
Author: Mike Gorse <mgorse novell com>
Date: Thu Dec 30 06:40:18 2010 -0500
Fix atspi_rect_copy and atspi_point_copy
atspi/atspi-component.c | 20 ++++++++++++++------
1 files 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]