VMS: don't use app_malloc() in apps/lib/vms_decc_argv.c
authorRichard Levitte <levitte@openssl.org>
Thu, 20 May 2021 08:31:21 +0000 (10:31 +0200)
committerRichard Levitte <levitte@openssl.org>
Sat, 22 May 2021 05:20:03 +0000 (07:20 +0200)
The reason being that it would otherwise force test programs to link
with all of libapps.a, which unfortunately causes multiple symbol
definition issues.

The quick and dirty fix is to use OPENSSL_malloc() instead of
app_malloc() in apps/lib/vms_decc_argv.c, and clean up libapps.a
later.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15368)

apps/lib/vms_decc_argv.c

index 932b51a837646bb125220d0924dc8b55ed88c872..25b42eb801f5caaf798bc18fc6c39eeced00d49d 100644 (file)
@@ -10,7 +10,6 @@
 #include <stdlib.h>
 #include <openssl/crypto.h>
 #include "platform.h"            /* for copy_argv() */
-#include "apps.h"                /* for app_malloc() */
 
 char **newargv = NULL;
 
@@ -51,7 +50,13 @@ char **copy_argv(int *argc, char *argv[])
 
     cleanup_argv();
 
-    newargv = app_malloc(sizeof(*newargv) * (count + 1), "argv copy");
+    /*
+     * We purposefully use OPENSSL_malloc() rather than app_malloc() here,
+     * to avoid symbol name clashes in test programs that would otherwise
+     * get them when linking with all of libapps.a.
+     * See comment in test/build.info.
+     */
+    newargv = OPENSSL_malloc(sizeof(*newargv) * (count + 1));
     if (newargv == NULL)
         return NULL;