From 4df92d57e86155e371b7797ed0bb51ff30e6450a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 6 Oct 2006 20:34:24 +0000 Subject: * nis/nis_table.c (nis_list): If __follow_path fails in the new code, make sure the nis_freeresult call doesn't crash and that the result is reported correctly. --- nis/nis_table.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'nis') diff --git a/nis/nis_table.c b/nis/nis_table.c index f898e3c66c..cb25be61e2 100644 --- a/nis/nis_table.c +++ b/nis/nis_table.c @@ -438,7 +438,11 @@ nis_list (const_nis_name name, unsigned int flags, &bptr); if (clnt_status != NIS_SUCCESS) { - NIS_RES_STATUS (res) = clnt_status; + /* Prepare for the nis_freeresult call. */ + memset (res, '\0', sizeof (*res)); + + if (clnt_status == NIS_NOMEMORY) + NIS_RES_STATUS (allres) = clnt_status; ++done; } } -- cgit 1.4.1