Re: [PATCH] API: Init conn in case of it might be used uninitialized

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



于 2011年09月02日 13:25, Wen Congyang 写道:
At 09/02/2011 12:52 PM, Osier Yang Write:
There is a goto before "conn" is initialized.
---
  src/libvirt.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/libvirt.c b/src/libvirt.c
index 4284954..eca919a 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -15225,12 +15225,13 @@ virDomainMigrateGetMaxSpeed(virDomainPtr domain,
          return -1;
      }

+    conn = domain->conn;
+
      if (!bandwidth) {
          virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
          goto error;
      }

-    conn = domain->conn;
      if (conn->flags&  VIR_CONNECT_RO) {
          virLibDomainError(VIR_ERR_OPERATION_DENIED, __FUNCTION__);
          goto error;
Ack

Thanks, pushed.

Osier

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]