- 193
- 0
- 约 3页
- 2017-06-07 发布于河南
- 举报
OpenSSL中SSL_library_init()函数的内存泄露的测试
测试环境 CentOS 6.2。
#include stdio.h
#include stdlib.h
#include openssl/ssl.h
#include openssl/err.h
void mytest() {
SSL_CTX *ctx;
SSL_load_error_strings();
SSL_library_init ();
ctx = SSL_CTX_new(SSLv23_client_method());
SSL_CTX_free(ctx);
ERR_free_strings();
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
}
void usage(char* cmd) {
? printf( \ncommand: myssl repeat_count (e.g. myssl 500)\n\n );
? exit( 1 );
}
int main(int argc, char** argv) {
? unsigned int i = 0;
? if (argc != 2) usage(argv[0]);
??
? printf( \n### ?OpenSSL TESTING ... ?###\n\n );
? for (i = 0; i atoi(argv[1]); i++) {
? ? printf( RE
原创力文档

文档评论(0)