Commit 3ecfd13d authored by Beniamino Galvani's avatar Beniamino Galvani

cli: fix reference count handling in hotspot error path

The connection is automatically unreferenced when the function
returns.

Fixes: 9c5ea091 ('devices: reuse the hotspot connection if we find appropriate one'):
parent 3e213578
......@@ -4192,7 +4192,6 @@ do_device_wifi_hotspot (const NMCCommand *cmd, NmCli *nmc, int argc, const char
g_return_if_fail (s_wsec);
if (!set_wireless_security_for_hotspot (s_wsec, wifi_mode, caps, password, show_password, &error)) {
g_object_unref (connection);
g_string_printf (nmc->return_text, _("Error: Invalid 'password': %s."), error->message);
g_clear_error (&error);
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment