aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/dbus/dbus_old_handlers.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2015-01-06 10:06:39 (GMT)
committerJouni Malinen <j@w1.fi>2015-01-07 11:19:00 (GMT)
commita2af1c70c5cad29599d31c5296628bec7013b6fd (patch)
treedb63697560715f242b3f1ef71167f6567713c99a /wpa_supplicant/dbus/dbus_old_handlers.c
parent3d2e2d5d6300c4be611cac67454e4aa0e8af54af (diff)
downloadhostap-a2af1c70c5cad29599d31c5296628bec7013b6fd.zip
hostap-a2af1c70c5cad29599d31c5296628bec7013b6fd.tar.gz
hostap-a2af1c70c5cad29599d31c5296628bec7013b6fd.tar.bz2
D-Bus (old): Fix memory leak on error path
If setSmartcardModules() fails to allocate memory with os_strdup(), the allocated items in the dict entry were not freed. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/dbus/dbus_old_handlers.c')
-rw-r--r--wpa_supplicant/dbus/dbus_old_handlers.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/wpa_supplicant/dbus/dbus_old_handlers.c b/wpa_supplicant/dbus/dbus_old_handlers.c
index 504de2a..955ea78 100644
--- a/wpa_supplicant/dbus/dbus_old_handlers.c
+++ b/wpa_supplicant/dbus/dbus_old_handlers.c
@@ -1134,25 +1134,27 @@ DBusMessage * wpas_dbus_iface_set_smartcard_modules(
entry.type == DBUS_TYPE_STRING) {
os_free(opensc_engine_path);
opensc_engine_path = os_strdup(entry.str_value);
+ wpa_dbus_dict_entry_clear(&entry);
if (opensc_engine_path == NULL)
goto error;
} else if (!strcmp(entry.key, "pkcs11_engine_path") &&
entry.type == DBUS_TYPE_STRING) {
os_free(pkcs11_engine_path);
pkcs11_engine_path = os_strdup(entry.str_value);
+ wpa_dbus_dict_entry_clear(&entry);
if (pkcs11_engine_path == NULL)
goto error;
} else if (!strcmp(entry.key, "pkcs11_module_path") &&
entry.type == DBUS_TYPE_STRING) {
os_free(pkcs11_module_path);
pkcs11_module_path = os_strdup(entry.str_value);
+ wpa_dbus_dict_entry_clear(&entry);
if (pkcs11_module_path == NULL)
goto error;
} else {
wpa_dbus_dict_entry_clear(&entry);
goto error;
}
- wpa_dbus_dict_entry_clear(&entry);
}
os_free(wpa_s->conf->opensc_engine_path);