about summary refs log tree commit diff
path: root/nis/nis_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nis_table.c')
-rw-r--r--nis/nis_table.c6
1 files changed, 5 insertions, 1 deletions
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;
 		  }
 	      }