diff options
author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2019-10-01 16:20:04 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-10-02 09:11:28 +0200 |
commit | b68bb97971b643c1766baee9b039a88ad55b9910 (patch) | |
tree | 9c9d22458f966bb333a24d2de76dccde216bdfbf | |
parent | c4c8889256fcf855b53d6f95d88535ec2dd738e5 (diff) | |
download | NetworkManager-b68bb97971b643c1766baee9b039a88ad55b9910.tar.gz |
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.
-rw-r--r-- | clients/cli/common.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c index 325f73abf5..d57ce6e6c9 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -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; |