]> xenbits.xensource.com Git - libvirt.git/commitdiff
fix build with older gcc
authorJán Tomko <jtomko@redhat.com>
Fri, 2 May 2014 07:37:34 +0000 (09:37 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 2 May 2014 07:37:34 +0000 (09:37 +0200)
Older gcc (4.1.2-55.el5, 4.2.1 on FreeBSD) reports bogus warnings:
../../src/conf/nwfilter_conf.c:2111: warning: 'protocol' may be used
uninitialized in this function
../../src/conf/nwfilter_conf.c:2110: warning: 'dataProtocolID' may be
used uninitialized in this function

Initialize them to NULL to make the compiler happy.

src/conf/nwfilter_conf.c

index 67b5482a1dd3ebd58b715eb69c31b3505f12ff2f..b9f6d5115ff6a93d405accfaa3abce6afaccc5ea 100644 (file)
@@ -2107,8 +2107,8 @@ virNWFilterRuleValidate(virNWFilterRuleDefPtr rule)
 {
     int ret = 0;
     portDataDefPtr portData = NULL;
-    nwItemDescPtr dataProtocolID;
-    const char *protocol;
+    nwItemDescPtr dataProtocolID = NULL;
+    const char *protocol = NULL;
 
     switch (rule->prtclType) {
     case VIR_NWFILTER_RULE_PROTOCOL_IP: