]> sourceware.org Git - glibc.git/blobdiff - nis/nis_checkpoint.c
Update.
[glibc.git] / nis / nis_checkpoint.c
index 585214a3b45658040ec4db4b0cba5aa66dc42cd9..3d5847295bbc262ea225a12033451f226e8cc02b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
 
@@ -17,6 +17,7 @@
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA. */
 
+#include <string.h>
 #include <rpcsvc/nis.h>
 
 #include "nis_xdr.h"
@@ -38,11 +39,15 @@ nis_checkpoint(const_nis_name dirname)
 
       res2 = nis_lookup (dirname, EXPAND_NAME);
       if (NIS_RES_STATUS (res2) != NIS_SUCCESS)
-        return res2;
+       {
+         free (res);
+         return res2;
+       }
 
       /* Check if obj is really a diryectory object */
       if (__type_of (NIS_RES_OBJECT (res2)) != NIS_DIRECTORY_OBJ)
        {
+         nis_freeresult (res2);
          nis_freeresult (res);
          NIS_RES_STATUS (res) = NIS_INVALIDOBJ;
          return res;
@@ -57,7 +62,7 @@ nis_checkpoint(const_nis_name dirname)
          if (__do_niscall2 (&NIS_RES_OBJECT(res2)->DI_data.do_servers.do_servers_val[i],
                             1, NIS_CHECKPOINT, (xdrproc_t) _xdr_nis_name,
                             (caddr_t) &dirname, (xdrproc_t) _xdr_cp_result,
-                            (caddr_t) &cpres, 0, NULL, NULL) != NIS_SUCCESS)
+                            (caddr_t) &cpres, 0, NULL) != NIS_SUCCESS)
            NIS_RES_STATUS (res) = NIS_RPCERROR;
          else
            {
This page took 0.027185 seconds and 5 git commands to generate.