diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
commit | a334319f6530564d22e775935d9c91663623a1b4 (patch) | |
tree | b5877475619e4c938e98757d518bb1e9cbead751 /nis/nis_clone_dir.c | |
parent | 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff) | |
download | glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz glibc-a334319f6530564d22e775935d9c91663623a1b4.zip |
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'nis/nis_clone_dir.c')
-rw-r--r-- | nis/nis_clone_dir.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/nis/nis_clone_dir.c b/nis/nis_clone_dir.c index f94a1eeb74..0271db1790 100644 --- a/nis/nis_clone_dir.c +++ b/nis/nis_clone_dir.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 <kukuk@vt.uni-paderborn.de>, 1997. @@ -26,27 +26,18 @@ directory_obj * nis_clone_directory (const directory_obj *src, directory_obj *dest) { - char *addr; + unsigned char *addr; unsigned int size; XDR xdrs; + directory_obj *res; if (src == NULL) - return NULL; + return (NULL); size = xdr_sizeof ((xdrproc_t)_xdr_directory_obj, (char *)src); if ((addr = calloc(1, size)) == NULL) return NULL; - xdrmem_create(&xdrs, addr, size, XDR_ENCODE); - if (!_xdr_directory_obj (&xdrs, (directory_obj *)src)) - { - xdr_destroy (&xdrs); - free (addr); - return NULL; - } - xdr_destroy (&xdrs); - - directory_obj *res; if (dest == NULL) { if ((res = calloc (1, sizeof (directory_obj))) == NULL) @@ -58,12 +49,18 @@ nis_clone_directory (const directory_obj *src, directory_obj *dest) else res = dest; + xdrmem_create(&xdrs, addr, size, XDR_ENCODE); + if (!_xdr_directory_obj (&xdrs, (directory_obj *)src)) + { + xdr_destroy (&xdrs); + free (addr); + return NULL; + } + xdr_destroy (&xdrs); xdrmem_create (&xdrs, addr, size, XDR_DECODE); if (!_xdr_directory_obj (&xdrs, res)) { xdr_destroy (&xdrs); - if (res != dest) - free (res); free (addr); return NULL; } |