summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugin/eurephia-auth.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugin/eurephia-auth.c b/plugin/eurephia-auth.c
index 41822d7..97fb38f 100644
--- a/plugin/eurephia-auth.c
+++ b/plugin/eurephia-auth.c
@@ -135,8 +135,6 @@ static inline int detect_tunnel_type(eurephiaCTX *ctx, const char const *env[])
"Unkown openvpn_devtype configuration value: '%s'. "
"Will try to auto-detect the type for the %s device.",
devtype, devname);
- free_nullsafe(ctx, devtype);
-
} else {
ctx->tuntype = tuntype;
forced = 1;
@@ -151,6 +149,7 @@ static inline int detect_tunnel_type(eurephiaCTX *ctx, const char const *env[])
ctx->tuntype = tuntype;
goto success;
}
+ free_nullsafe(ctx, devtype);
// If no 'dev_type', try to guess the dev-type based on the dev name
tuntype = conv_str2tuntype(devname);
@@ -165,6 +164,7 @@ static inline int detect_tunnel_type(eurephiaCTX *ctx, const char const *env[])
"You need to force the tunnel device type setting the 'openvpn_devtype' "
"configuration value.",
devname);
+ free_nullsafe(ctx, devname);
return 0;
success:
@@ -172,7 +172,6 @@ static inline int detect_tunnel_type(eurephiaCTX *ctx, const char const *env[])
"OpenVPN device type is %s %s on the %s device.",
(forced ? "forced to" : "detected as"),
(tuntype == tuntype_TUN ? "TUN" : "TAP"), devname);
- free_nullsafe(ctx, devtype);
free_nullsafe(ctx, devname);
return 1;
}