summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vpn/plugins/ipsec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vpn/plugins/ipsec.c b/vpn/plugins/ipsec.c
index 7a2675e0..fa9dc7af 100644
--- a/vpn/plugins/ipsec.c
+++ b/vpn/plugins/ipsec.c
@@ -714,7 +714,7 @@ static int ipsec_load_shared_psk(struct vpn_provider *provider)
if (!provider) {
connman_error("invalid provider");
- ret = -EINVAL;
+ return -EINVAL;
}
data = vpn_provider_get_string(provider, "IPsec.IKEData");
@@ -840,8 +840,10 @@ static int ipsec_load_key(struct vpn_provider *provider)
return 0;
sect = vici_create_section(NULL);
- if (!sect)
+ if (!sect) {
+ g_free(data);
return -ENOMEM;
+ }
vici_add_kv(sect, "type", type, NULL);
vici_add_kv(sect, "data", data, NULL);