about summary refs log tree commit diff
path: root/nss/nsswitch.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/nsswitch.c')
-rw-r--r--nss/nsswitch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 6c15c3a83f..535d93bb95 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -384,7 +384,10 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
      will be passed to `known_compare' (above).  */
 
   found = __tsearch (&fct_name, &ni->known, &known_compare);
-  if (*found != &fct_name)
+  if (found == NULL)
+    /* This means out-of-memory.  */
+    result = NULL;
+  else if (*found != &fct_name)
     {
       /* The search found an existing structure in the tree.  */
       result = ((known_function *) *found)->fct_ptr;