From a334319f6530564d22e775935d9c91663623a1b4 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 22 Dec 2004 20:10:10 +0000 Subject: (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. --- nis/nis_clone_res.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'nis/nis_clone_res.c') diff --git a/nis/nis_clone_res.c b/nis/nis_clone_res.c index 021f7cb4f4..135f397911 100644 --- a/nis/nis_clone_res.c +++ b/nis/nis_clone_res.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1997, 1998, 2005, 2006 Free Software Foundation, Inc. +/* Copyright (c) 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk , 1997. @@ -26,9 +26,10 @@ nis_result * nis_clone_result (const nis_result *src, nis_result *dest) { - char *addr; + unsigned char *addr; unsigned int size; XDR xdrs; + nis_result *res; if (src == NULL) return (NULL); @@ -37,16 +38,6 @@ nis_clone_result (const nis_result *src, nis_result *dest) if ((addr = calloc(1, size)) == NULL) return NULL; - xdrmem_create (&xdrs, addr, size, XDR_ENCODE); - if (!_xdr_nis_result (&xdrs, (nis_result *)src)) - { - xdr_destroy (&xdrs); - free (addr); - return NULL; - } - xdr_destroy (&xdrs); - - nis_result *res; if (dest == NULL) { if ((res = calloc (1, sizeof (nis_result))) == NULL) @@ -58,12 +49,18 @@ nis_clone_result (const nis_result *src, nis_result *dest) else res = dest; - xdrmem_create (&xdrs, addr, size, XDR_DECODE); - if (!_xdr_nis_result (&xdrs, res)) + xdrmem_create(&xdrs, addr, size, XDR_ENCODE); + if (!_xdr_nis_result (&xdrs, (nis_result *)src)) + { + xdr_destroy (&xdrs); + free (addr); + return NULL; + } + xdr_destroy (&xdrs); + xdrmem_create(&xdrs, addr, size, XDR_DECODE); + if (!_xdr_nis_result(&xdrs, res)) { xdr_destroy (&xdrs); - if (res != dest) - free (res); free (addr); return NULL; } -- cgit v1.2.1