Skip to content

Commit

Permalink
* nis/nis_table.c (get_tablepath): Renamed from __get_tablepath.
Browse files Browse the repository at this point in the history
	Adjust all callers.
	Free res object content before returning.
  • Loading branch information
Ulrich Drepper committed May 5, 2006
1 parent 5e65a53 commit 3e4370c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 9 additions & 4 deletions nis/nis_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 *
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3e4370c

Please sign in to comment.