about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-05-05 03:52:25 +0000
committerUlrich Drepper <drepper@redhat.com>2006-05-05 03:52:25 +0000
commit3e4370cf2b647d5c1ff8579283878f59875d3645 (patch)
treeb4d7f5f88ea31605ea00db2bc0bc5dfb9bbe4998
parent5e65a53d5474bc0baf0ea6d90548e22b3ee7b501 (diff)
downloadglibc-3e4370cf2b647d5c1ff8579283878f59875d3645.tar.gz
glibc-3e4370cf2b647d5c1ff8579283878f59875d3645.tar.xz
glibc-3e4370cf2b647d5c1ff8579283878f59875d3645.zip
* nis/nis_table.c (get_tablepath): Renamed from __get_tablepath. cvs/fedora-glibc-20060505T0554
	Adjust all callers.
	Free res object content before returning.
-rw-r--r--ChangeLog4
-rw-r--r--nis/nis_table.c13
2 files changed, 13 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index b5222c7a53..5a0eb1234e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-05-04  Ulrich Drepper  <drepper@redhat.com>
 
+	* nis/nis_table.c (get_tablepath): Renamed from __get_tablepath.
+	Adjust all callers.
+	Free res object content before returning.
+
 	* sunrpc/xdr_array.c (xdr_array): Use calloc instead of malloc&bzero.
 
 	* sunrpc/key_call.c (__rpc_thread_key_cleanup): Also free
diff --git a/nis/nis_table.c b/nis/nis_table.c
index f56b499f60..1a7bf094f0 100644
--- a/nis/nis_table.c
+++ b/nis/nis_table.c
@@ -129,7 +129,7 @@ __create_ib_request (const_nis_name name, unsigned int flags)
 static const struct timeval RPCTIMEOUT = {10, 0};
 
 static char *
-__get_tablepath (char *name, dir_binding *bptr)
+get_tablepath (char *name, dir_binding *bptr)
 {
   enum clnt_stat result;
   nis_result res;
@@ -152,7 +152,12 @@ __get_tablepath (char *name, dir_binding *bptr)
   else
     cptr = "";
 
-  return strdup (cptr);
+  char *str = strdup (cptr);
+
+  if (result == RPC_SUCCESS)
+    xdr_free ((xdrproc_t) _xdr_nis_result, (char *) &res);
+
+  return str;
 }
 
 nis_result *
@@ -335,7 +340,7 @@ nis_list (const_nis_name name, unsigned int flags,
 	      {
 		if (tablepath == NULL)
 		  {
-		    tablepath = __get_tablepath (ibreq->ibr_name, &bptr);
+		    tablepath = get_tablepath (ibreq->ibr_name, &bptr);
 		    tableptr = tablepath;
 		  }
 		if (tableptr == NULL)
@@ -400,7 +405,7 @@ nis_list (const_nis_name name, unsigned int flags,
 		  {
 		    if (tablepath == NULL)
 		      {
-			tablepath = __get_tablepath (ibreq->ibr_name, &bptr);
+			tablepath = get_tablepath (ibreq->ibr_name, &bptr);
 			tableptr = tablepath;
 		      }
 		    if (tableptr == NULL)