swconfig: Bugfix switch_port uci option parsing
[openwrt/staging/yousong.git] / package / network / config / swconfig / src / uci.c
index bbeeb0311197767b39748f079f3eb705da9064fc..bf76bd3de1d3e1c5c906e410d3e13125529522fc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * uci.c: UCI binding for the switch configuration utility
  *
- * Copyright (C) 2009 Felix Fietkau <nbd@openwrt.org>
+ * Copyright (C) 2009 Felix Fietkau <nbd@nbd.name>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -165,7 +165,7 @@ found:
                s = uci_to_section(e);
 
                if (!strcmp(s->type, "switch_port")) {
-                       char *devn, *port, *port_err = NULL;
+                       char *devn = NULL, *port = NULL, *port_err = NULL;
                        int port_n;
 
                        uci_foreach_element(&s->options, os) {
@@ -190,7 +190,7 @@ found:
 
                        swlib_map_settings(dev, SWLIB_ATTR_GROUP_PORT, port_n, s);
                } else if (!strcmp(s->type, "switch_vlan")) {
-                       char *devn, *vlan, *vlan_err = NULL;
+                       char *devn = NULL, *vlan = NULL, *vlan_err = NULL;
                        int vlan_n;
 
                        uci_foreach_element(&s->options, os) {