diff options
author | Richard Levitte <levitte@openssl.org> | 2002-04-18 16:20:13 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2002-04-18 16:20:13 +0000 |
commit | 6176df94ed4a8c217546ac31d11d4d72140df3f5 (patch) | |
tree | 3c34032bfd35833506260ba24172e8f22502b9a1 /ssl | |
parent | a8f8788248f8c702805942917e6ddb7eee6f73fe (diff) |
Make sure the opened directory is closed on exit.
Notified by Lorinczy Zsigmond <lzsiga@mail.ahiv.hu>
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_cert.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c index 1a873d2cb7..0c5d05fb41 100644 --- a/ssl/ssl_cert.c +++ b/ssl/ssl_cert.c @@ -773,6 +773,7 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, ret = 1; err: + if (d) closedir(d); CRYPTO_w_unlock(CRYPTO_LOCK_READDIR); return ret; } @@ -798,7 +799,7 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, 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; + goto err_noclose; } do @@ -819,10 +820,11 @@ int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, goto err; } while (FindNextFile(hFind, &FindFileData) != FALSE); - FindClose(hFind); ret = 1; -err: +err: + FindClose(hFind); +err_noclose: CRYPTO_w_unlock(CRYPTO_LOCK_READDIR); return ret; } |