diff options
author | taesub kim <taesub.kim@samsung.com> | 2017-09-28 05:20:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.ap-northeast-2.compute.internal> | 2017-09-28 05:20:18 +0000 |
commit | 5a96125615ae3832ae04e30b2fe34abaed5e4fc9 (patch) | |
tree | bb75e08647509ed136177694049ffc9a15e523ab | |
parent | 9643dfc0b066e2c6ff7a90774e8913d0dc542726 (diff) | |
parent | 3d1ecd4dbe486eebf7c9dad6b49152b83b888302 (diff) | |
download | connman-5a96125615ae3832ae04e30b2fe34abaed5e4fc9.tar.gz connman-5a96125615ae3832ae04e30b2fe34abaed5e4fc9.tar.bz2 connman-5a96125615ae3832ae04e30b2fe34abaed5e4fc9.zip |
Merge "[CID-26975, 36747] Fix memory leak and dereference after null check" into tizen
-rw-r--r-- | vpn/plugins/ipsec.c | 6 |
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); |