cli: Assert we don't require multiple commands during client initalization

If a new command was requested while a client was in the process of being
created we were just requesting a new client.

This was causing leak, so let's strongly ensure this is not the case.
This commit is contained in:
Marco Trevisan (Treviño) 2019-10-01 16:20:04 +02:00 committed by Thomas Haller
parent c4c8889256
commit b68bb97971

View file

@ -1251,6 +1251,8 @@ call_cmd (NmCli *nmc, GTask *task, const NMCCommand *cmd, int argc, char **argv)
g_object_unref (task);
} else {
nm_assert (nmc->client == NULL);
nmc->should_wait++;
call = g_slice_new0 (CmdCall);
call->cmd = cmd;