From b68bb97971b643c1766baee9b039a88ad55b9910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 1 Oct 2019 16:20:04 +0200 Subject: [PATCH] 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. --- clients/cli/common.c | 2 ++ 1 file changed, 2 insertions(+) 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;