]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
dl_name_converter: Avoid unnecessary overallocation
authorTomas Mraz <tomas@openssl.org>
Wed, 9 Jun 2021 14:42:35 +0000 (16:42 +0200)
committerPauli <pauli@openssl.org>
Thu, 10 Jun 2021 22:52:14 +0000 (08:52 +1000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15680)

crypto/dso/dso_dl.c

index e41648548ea4371ba62a746e955b58c432f075c2..8d440ab3e2c0995b678d07c29dbaff8ed0f2ddfd 100644 (file)
@@ -224,7 +224,7 @@ static char *dl_name_converter(DSO *dso, const char *filename)
     len = strlen(filename);
     rsize = len + 1;
     transform = (strstr(filename, "/") == NULL);
-    {
+    if (transform) {
         /* We will convert this to "%s.s?" or "lib%s.s?" */
         rsize += strlen(DSO_EXTENSION); /* The length of ".s?" */
         if ((DSO_flags(dso) & DSO_FLAG_NAME_TRANSLATION_EXT_ONLY) == 0)