From 651d67b2c2cb5f51738cbdbc25409299e139c0f1 Mon Sep 17 00:00:00 2001 From: "chleun.moon" Date: Thu, 4 May 2017 15:23:33 +0900 Subject: Fix svace issues (WGID-207858, 208122, 208137, 208138) Change-Id: I31373fbb6ad79517e63f4023c1f4bac2f63424e5 Signed-off-by: cheoleun --- vpn/plugins/ipsec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'vpn') diff --git a/vpn/plugins/ipsec.c b/vpn/plugins/ipsec.c index e4bbf2b3..cd8b625a 100644 --- a/vpn/plugins/ipsec.c +++ b/vpn/plugins/ipsec.c @@ -722,7 +722,7 @@ static char *load_file_from_path(const char *path) size_t file_size = 0; char *file_buff = NULL; - if (path) { + if (!path) { connman_error("File path is NULL\n"); return NULL; } @@ -841,6 +841,7 @@ static int ipsec_load_cert(struct vpn_provider *provider) DBG("CertType: %s, CertFalg: %s,CertData: %s", type, flag, data); if (!type || ! flag || !data) { connman_error("invalid certification information"); + g_free(data); return -EINVAL; } @@ -971,6 +972,9 @@ done: if(err != 0 && cb) cb(provider, data->user_data, -err); + if (data) + g_free(data); + return; } -- cgit v1.2.3