summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorManeesh Jain <maneesh.jain@samsung.com>2015-06-18 18:47:25 +0530
committerPatrik Flykt <patrik.flykt@linux.intel.com>2015-06-22 15:10:43 +0300
commit999ef16639cd0a6e4941243f44d260d76422b0f8 (patch)
tree7de36d2e50c566e09b42a03795087166285ad0b9 /gsupplicant
parent9e9d25792e76c3b3e5cc66d67bba34c059dcaec1 (diff)
downloadconnman-999ef16639cd0a6e4941243f44d260d76422b0f8.tar.gz
gsupplicant: Fix possible memory leak in g_supplicant_set_country()
In case supplicant_dbus_property_set() function returns error, 'regdom' memory is not freed.
Diffstat (limited to 'gsupplicant')
-rwxr-xr-xgsupplicant/supplicant.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index fb62a97a..38cbad1e 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -3273,6 +3273,7 @@ int g_supplicant_set_country(const char *alpha2,
const void *user_data)
{
struct supplicant_regdom *regdom;
+ int ret;
SUPPLICANT_DBG("Country setting %s", alpha2);
@@ -3287,10 +3288,15 @@ int g_supplicant_set_country(const char *alpha2,
regdom->alpha2 = alpha2;
regdom->user_data = user_data;
- return supplicant_dbus_property_set(SUPPLICANT_PATH, SUPPLICANT_INTERFACE,
+ ret = supplicant_dbus_property_set(SUPPLICANT_PATH, SUPPLICANT_INTERFACE,
"Country", DBUS_TYPE_STRING_AS_STRING,
country_params, country_result,
regdom, NULL);
+ if (ret < 0) {
+ dbus_free(regdom);
+ SUPPLICANT_DBG("Unable to set Country configuration");
+ }
+ return ret;
}
int g_supplicant_interface_set_country(GSupplicantInterface *interface,