mirror of https://github.com/openssl/openssl.git
Use OPENSSL_strdup() for strings freed by OPENSSL_free()
Things can get messy when application decides to use it's own memory allocation functions using CRYPTO_set_mem_functions(3ossl) Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/27163)
This commit is contained in:
parent
50f945117c
commit
7fa51041e4
|
|
@ -127,7 +127,7 @@ static int set_random_provider_name(RAND_GLOBAL *dgbl, const char *name)
|
|||
return 1;
|
||||
|
||||
OPENSSL_free(dgbl->random_provider_name);
|
||||
dgbl->random_provider_name = strdup(name);
|
||||
dgbl->random_provider_name = OPENSSL_strdup(name);
|
||||
return dgbl->random_provider_name != NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ static char *change_path(const char *file)
|
|||
|
||||
ret = chdir(s);
|
||||
if (ret == 0)
|
||||
new_config_name = strdup(last + DIRSEP_PRESERVE + 1);
|
||||
new_config_name = OPENSSL_strdup(last + DIRSEP_PRESERVE + 1);
|
||||
err:
|
||||
OPENSSL_free(s);
|
||||
return new_config_name;
|
||||
|
|
|
|||
Loading…
Reference in New Issue