[PATCH:libXdmcp 2/2] Make XdmcpCopyARRAY8 call XdmcpAllocARRAY8 instead of replicating it
Alan Coopersmith
alan.coopersmith at oracle.com
Sat May 4 19:20:42 PDT 2013
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
Array.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/Array.c b/Array.c
index 4f0561f..f529781 100644
--- a/Array.c
+++ b/Array.c
@@ -145,12 +145,8 @@ XdmcpARRAY8Equal (const ARRAY8Ptr array1, const ARRAY8Ptr array2)
int
XdmcpCopyARRAY8 (const ARRAY8Ptr src, ARRAY8Ptr dst)
{
- dst->data = (CARD8 *) xmalloc(src->length * sizeof (CARD8));
- if (!dst->data) {
- dst->length = 0;
+ if (!XdmcpAllocARRAY8(dst, src->length))
return FALSE;
- }
- dst->length = src->length;
memmove (dst->data, src->data, src->length * sizeof (CARD8));
return TRUE;
}
--
1.7.9.2
More information about the xorg-devel
mailing list