]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Use OPENSSL_strdup() for strings freed by OPENSSL_free()
authorsashan <anedvedicky@gmail.com>
Wed, 26 Mar 2025 08:37:01 +0000 (09:37 +0100)
committerTomas Mraz <tomas@openssl.org>
Thu, 27 Mar 2025 11:05:36 +0000 (12:05 +0100)
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)

(cherry picked from commit 7fa51041e4d68838b2c7ddf4f77d6bba0edf2735)

test/conf_include_test.c

index 9b777de396554104c3edc06420ff56877c785d81..c84efb3c5d475a8ea91c3cd908b13b5a72ac7827 100644 (file)
@@ -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;