diff --git a/src/openvpn/auth_token.c b/src/openvpn/auth_token.c
index 84558af..10c656e 100644
--- a/src/openvpn/auth_token.c
+++ b/src/openvpn/auth_token.c
@@ -275,7 +275,7 @@
 
     /* free the auth-token if defined, we will replace it with a new one */
     free(multi->auth_token);
-    multi->auth_token = strdup((char *)BPTR(&session_token));
+    multi->auth_token = string_alloc((char *)BPTR(&session_token), NULL);
 
     dmsg(D_SHOW_KEYS, "Generated token for client: %s (%s)", multi->auth_token, up->username);
 
@@ -285,7 +285,7 @@
          * Save the initial auth token to continue using the same session ID
          * and timestamp in updates
          */
-        multi->auth_token_initial = strdup(multi->auth_token);
+        multi->auth_token_initial = string_alloc(multi->auth_token, NULL);
     }
 
     gc_free(&gc);
diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
index 3f514d6..662fc9d 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -395,6 +395,7 @@
     m->max_clients = t->options.max_clients;
 
     m->instances = calloc(m->max_clients, sizeof(struct multi_instance *));
+    check_malloc_return(m->instances);
 
     m->top.c2.event_set = t->c2.event_set;
 
@@ -2653,7 +2654,7 @@
         }
 
         multi->locked_original_username = multi->locked_username;
-        multi->locked_username = strdup(options->override_username);
+        multi->locked_username = string_alloc(options->override_username, NULL);
 
         /* Override also the common name if username should be set as common
          * name */
diff --git a/src/openvpn/ssl_verify.c b/src/openvpn/ssl_verify.c
index 0cdec1e..9b3f86d 100644
--- a/src/openvpn/ssl_verify.c
+++ b/src/openvpn/ssl_verify.c
@@ -1658,7 +1658,7 @@
          * using the same session ID and initial timestamp in new tokens */
         if (!multi->auth_token_initial && (ks->auth_token_state_flags & AUTH_TOKEN_HMAC_OK))
         {
-            multi->auth_token_initial = strdup(up->password);
+            multi->auth_token_initial = string_alloc(up->password, NULL);
         }
 
         if (session->opt->auth_token_call_auth)
@@ -1777,7 +1777,7 @@
             if (!multi->auth_token && (ks->auth_token_state_flags & AUTH_TOKEN_HMAC_OK)
                 && !(ks->auth_token_state_flags & AUTH_TOKEN_EXPIRED))
             {
-                multi->auth_token = strdup(up->password);
+                multi->auth_token = string_alloc(up->password, NULL);
             }
 
             /*
diff --git a/src/openvpn/ssl_verify_openssl.c b/src/openvpn/ssl_verify_openssl.c
index 0c36cf2..3f1200d 100644
--- a/src/openvpn/ssl_verify_openssl.c
+++ b/src/openvpn/ssl_verify_openssl.c
@@ -323,11 +323,10 @@
     const ASN1_INTEGER *asn1_i = X509_get_serialNumber(cert);
     BIGNUM *bn_serial = ASN1_INTEGER_to_BN(asn1_i, NULL);
     int len_serial = BN_num_bytes(bn_serial);
-    unsigned char *buf = malloc(len_serial);
+    unsigned char *buf = gc_malloc(len_serial, false, gc);
     BN_bn2binpad(bn_serial, buf, len_serial);
 
     char *ret = format_hex_ex(buf, len_serial, 0, 1, ":", gc);
-    free(buf);
     BN_free(bn_serial);
 
     return ret;
