summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/engine/eng_dyn.c
diff options
context:
space:
mode:
authormarkus <>2002-09-10 16:31:57 +0000
committermarkus <>2002-09-10 16:31:57 +0000
commit7d038e9d4d83e7c7120e78418e108df70b9025d6 (patch)
treebaf775b286ff801a89f746b1938a3c700bba6822 /src/lib/libcrypto/engine/eng_dyn.c
parent3bd21dd4c3a3e3106321a5f6b3641ab9f18a6e3b (diff)
downloadopenbsd-7d038e9d4d83e7c7120e78418e108df70b9025d6.tar.gz
openbsd-7d038e9d4d83e7c7120e78418e108df70b9025d6.tar.bz2
openbsd-7d038e9d4d83e7c7120e78418e108df70b9025d6.zip
merge openssl-0.9.7-beta3, tested on vax by miod@
Diffstat (limited to 'src/lib/libcrypto/engine/eng_dyn.c')
-rw-r--r--src/lib/libcrypto/engine/eng_dyn.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/lib/libcrypto/engine/eng_dyn.c b/src/lib/libcrypto/engine/eng_dyn.c
index 4fefcc0cae..4139a16e76 100644
--- a/src/lib/libcrypto/engine/eng_dyn.c
+++ b/src/lib/libcrypto/engine/eng_dyn.c
@@ -157,6 +157,10 @@ static void dynamic_data_ctx_free_func(void *parent, void *ptr,
157 dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr; 157 dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr;
158 if(ctx->dynamic_dso) 158 if(ctx->dynamic_dso)
159 DSO_free(ctx->dynamic_dso); 159 DSO_free(ctx->dynamic_dso);
160 if(ctx->DYNAMIC_LIBNAME)
161 OPENSSL_free((void*)ctx->DYNAMIC_LIBNAME);
162 if(ctx->engine_id)
163 OPENSSL_free((void*)ctx->engine_id);
160 OPENSSL_free(ctx); 164 OPENSSL_free(ctx);
161 } 165 }
162 } 166 }
@@ -169,7 +173,7 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
169 { 173 {
170 dynamic_data_ctx *c; 174 dynamic_data_ctx *c;
171 c = OPENSSL_malloc(sizeof(dynamic_data_ctx)); 175 c = OPENSSL_malloc(sizeof(dynamic_data_ctx));
172 if(!ctx) 176 if(!c)
173 { 177 {
174 ENGINEerr(ENGINE_F_SET_DATA_CTX,ERR_R_MALLOC_FAILURE); 178 ENGINEerr(ENGINE_F_SET_DATA_CTX,ERR_R_MALLOC_FAILURE);
175 return 0; 179 return 0;
@@ -310,8 +314,13 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)())
310 /* a NULL 'p' or a string of zero-length is the same thing */ 314 /* a NULL 'p' or a string of zero-length is the same thing */
311 if(p && (strlen((const char *)p) < 1)) 315 if(p && (strlen((const char *)p) < 1))
312 p = NULL; 316 p = NULL;
313 ctx->DYNAMIC_LIBNAME = (const char *)p; 317 if(ctx->DYNAMIC_LIBNAME)
314 return 1; 318 OPENSSL_free((void*)ctx->DYNAMIC_LIBNAME);
319 if(p)
320 ctx->DYNAMIC_LIBNAME = BUF_strdup(p);
321 else
322 ctx->DYNAMIC_LIBNAME = NULL;
323 return (ctx->DYNAMIC_LIBNAME ? 1 : 0);
315 case DYNAMIC_CMD_NO_VCHECK: 324 case DYNAMIC_CMD_NO_VCHECK:
316 ctx->no_vcheck = ((i == 0) ? 0 : 1); 325 ctx->no_vcheck = ((i == 0) ? 0 : 1);
317 return 1; 326 return 1;
@@ -319,8 +328,13 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)())
319 /* a NULL 'p' or a string of zero-length is the same thing */ 328 /* a NULL 'p' or a string of zero-length is the same thing */
320 if(p && (strlen((const char *)p) < 1)) 329 if(p && (strlen((const char *)p) < 1))
321 p = NULL; 330 p = NULL;
322 ctx->engine_id = (const char *)p; 331 if(ctx->engine_id)
323 return 1; 332 OPENSSL_free((void*)ctx->engine_id);
333 if(p)
334 ctx->engine_id = BUF_strdup(p);
335 else
336 ctx->engine_id = NULL;
337 return (ctx->engine_id ? 1 : 0);
324 case DYNAMIC_CMD_LIST_ADD: 338 case DYNAMIC_CMD_LIST_ADD:
325 if((i < 0) || (i > 2)) 339 if((i < 0) || (i > 2))
326 { 340 {