correct error signalling for opendir() failure
[openssl.git] / ssl / ssl_cert.c
index 19ade2fa4ecd21abb15c78b95a8d5588c4e69fec..b33658f017b1e21862c33e08abb6a3162dfbf5f2 100644 (file)
@@ -685,7 +685,9 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack,
     /* Note that a side effect is that the CAs will be sorted by name */
     if(!d)
        {
-       SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK,ERR_R_MALLOC_FAILURE);
+       SYSerr(SYS_F_OPENDIR, get_last_sys_error());
+       ERR_add_error_data(3, "opendir('", dir, "')");
+       SSLerr(SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK, ERR_R_SYS_LIB);
        goto err;
        }