285d04
diff --git a/lib/ssl/authcert.c b/lib/ssl/authcert.c
285d04
--- a/lib/ssl/authcert.c
285d04
+++ b/lib/ssl/authcert.c
285d04
@@ -201,16 +201,19 @@ NSS_GetClientAuthData(void *arg,
285d04
 
285d04
     /* otherwise look through the cache based on usage
285d04
      * if chosenNickname is set, we ignore the expiration date */
285d04
     if (certList == NULL) {
285d04
         certList = CERT_FindUserCertsByUsage(CERT_GetDefaultCertDB(),
285d04
                                              certUsageSSLClient,
285d04
                                              PR_FALSE, chosenNickName == NULL,
285d04
                                              pw_arg);
285d04
+        if (certList == NULL) {
285d04
+            return SECFailure;
285d04
+        }
285d04
         /* filter only the certs that meet the nickname requirements */
285d04
         if (chosenNickName) {
285d04
             rv = CERT_FilterCertListByNickname(certList, chosenNickName,
285d04
                                                pw_arg);
285d04
         } else {
285d04
             int nnames = 0;
285d04
             char **names = ssl_DistNamesToStrings(caNames, &nnames);
285d04
             rv = CERT_FilterCertListByCANames(certList, nnames, names,