mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
util: vircommand: fix redundant if
Comparison "if (ret == -1)" is always false.
This statement was forgotten during switching to g_new0()
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 0275b06a55
("util: command: use g_new0")
Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
d448eccf69
commit
bb673117d5
@ -2227,7 +2227,7 @@ virCommandProcessIO(virCommand *cmd)
|
||||
int outfd = -1, errfd = -1;
|
||||
size_t inlen = 0, outlen = 0, errlen = 0;
|
||||
size_t inoff = 0;
|
||||
int ret = 0;
|
||||
int ret = -1;
|
||||
g_autofree struct pollfd *fds = NULL;
|
||||
|
||||
if (dryRunBuffer || dryRunCallback) {
|
||||
@ -2254,9 +2254,6 @@ virCommandProcessIO(virCommand *cmd)
|
||||
VIR_FREE(*cmd->errbuf);
|
||||
*cmd->errbuf = g_new0(char, 1);
|
||||
}
|
||||
if (ret == -1)
|
||||
goto cleanup;
|
||||
ret = -1;
|
||||
|
||||
fds = g_new0(struct pollfd, 3 + virCommandGetNumSendBuffers(cmd));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user