From abd9b10898e82011a65d8e8fca56bf56532edd69 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Fri, 30 May 2014 06:22:57 +0000 Subject: more: no need for null check before free ok tedu guenther --- src/lib/libcrypto/engine/eng_dyn.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/lib/libcrypto/engine/eng_dyn.c') diff --git a/src/lib/libcrypto/engine/eng_dyn.c b/src/lib/libcrypto/engine/eng_dyn.c index f59d768350..e2de4603ee 100644 --- a/src/lib/libcrypto/engine/eng_dyn.c +++ b/src/lib/libcrypto/engine/eng_dyn.c @@ -169,10 +169,8 @@ static void dynamic_data_ctx_free_func(void *parent, void *ptr, dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr; if(ctx->dynamic_dso) DSO_free(ctx->dynamic_dso); - if(ctx->DYNAMIC_LIBNAME) - free((void*)ctx->DYNAMIC_LIBNAME); - if(ctx->engine_id) - free((void*)ctx->engine_id); + free((void *)ctx->DYNAMIC_LIBNAME); + free((void *)ctx->engine_id); if(ctx->dirs) sk_OPENSSL_STRING_pop_free(ctx->dirs, int_free_str); free(ctx); @@ -335,8 +333,7 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)) /* a NULL 'p' or a string of zero-length is the same thing */ if(p && (strlen((const char *)p) < 1)) p = NULL; - if(ctx->DYNAMIC_LIBNAME) - free((void*)ctx->DYNAMIC_LIBNAME); + free((void *)ctx->DYNAMIC_LIBNAME); if(p) ctx->DYNAMIC_LIBNAME = BUF_strdup(p); else @@ -349,8 +346,7 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)) /* a NULL 'p' or a string of zero-length is the same thing */ if(p && (strlen((const char *)p) < 1)) p = NULL; - if(ctx->engine_id) - free((void*)ctx->engine_id); + free((void *)ctx->engine_id); if(p) ctx->engine_id = BUF_strdup(p); else -- cgit v1.2.3-55-g6feb