A few places are using 0 in place of the MTYPE_* argument.  The
following rewrite of the alloc tracking won't deal with that, so let's
use MTYPE_TMP instead.

Signed-off-by: David Lamparter <equi...@opensourcerouting.org>
Acked-by: Vincent JARDIN <vincent.jar...@6wind.com>
Acked-by: Donald Sharp <sha...@cumulusnetworks.com>
---
 lib/prefix.c                |  2 +-
 ospfclient/ospf_apiclient.h |  2 +-
 ospfd/ospf_opaque.c         |  6 +++---
 ospfd/ospf_snmp.c           |  4 ++--
 ospfd/ospf_te.c             |  2 +-
 vtysh/vtysh_main.c          |  2 +-
 vtysh/vtysh_user.c          |  2 +-
 zebra/zebra_rib.c           | 10 +++++-----
 zebra/zserv.c               |  2 +-
 9 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/lib/prefix.c b/lib/prefix.c
index 3e4ca16..aeb627b 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -566,7 +566,7 @@ str2prefix_ipv6 (const char *str, struct prefix_ipv6 *p)
     {
       int plen;
 
-      cp = XMALLOC (0, (pnt - str) + 1);
+      cp = XMALLOC (MTYPE_TMP, (pnt - str) + 1);
       strncpy (cp, str, pnt - str);
       *(cp + (pnt - str)) = '\0';
       ret = inet_pton (AF_INET6, cp, &p->prefix);
diff --git a/ospfclient/ospf_apiclient.h b/ospfclient/ospf_apiclient.h
index 0e74787..8098619 100644
--- a/ospfclient/ospf_apiclient.h
+++ b/ospfclient/ospf_apiclient.h
@@ -23,7 +23,7 @@
 #ifndef _OSPF_APICLIENT_H
 #define _OSPF_APICLIENT_H
 
-#define MTYPE_OSPF_APICLIENT 0
+#define MTYPE_OSPF_APICLIENT MTYPE_TMP
 
 /* Structure for the OSPF API client */
 struct ospf_apiclient
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index 61e98f4..697655d 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -22,9 +22,9 @@
  */
 
 /***** MTYPE definitions are not reflected to "memory.h" yet. *****/
-#define MTYPE_OSPF_OPAQUE_FUNCTAB      0
-#define MTYPE_OPAQUE_INFO_PER_TYPE     0
-#define MTYPE_OPAQUE_INFO_PER_ID       0
+#define MTYPE_OSPF_OPAQUE_FUNCTAB      MTYPE_TMP
+#define MTYPE_OPAQUE_INFO_PER_TYPE     MTYPE_TMP
+#define MTYPE_OPAQUE_INFO_PER_ID       MTYPE_TMP
 
 #include <zebra.h>
 
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index ebeffa8..1f9b851 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -1420,13 +1420,13 @@ struct ospf_snmp_if
 static struct ospf_snmp_if *
 ospf_snmp_if_new (void)
 {
-  return XCALLOC (0, sizeof (struct ospf_snmp_if));
+  return XCALLOC (MTYPE_TMP, sizeof (struct ospf_snmp_if));
 }
 
 static void
 ospf_snmp_if_free (struct ospf_snmp_if *osif)
 {
-  XFREE (0, osif);
+  XFREE (MTYPE_TMP, osif);
 }
 
 void
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index cd52866..03109bc 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -22,7 +22,7 @@
  */
 
 /***** MTYPE definition is not reflected to "memory.h" yet. *****/
-#define MTYPE_OSPF_MPLS_TE_LINKPARAMS  0
+#define MTYPE_OSPF_MPLS_TE_LINKPARAMS  MTYPE_TMP
 
 #include <zebra.h>
 
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index 02a19b7..e82771b 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -251,7 +251,7 @@ main (int argc, char **argv, char **env)
        case 'c':
          {
            struct cmd_rec *cr;
-           cr = XMALLOC(0, sizeof(*cr));
+           cr = XMALLOC(MTYPE_TMP, sizeof(*cr));
            cr->line = optarg;
            cr->next = NULL;
            if (tail)
diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c
index 239a633..248b181 100644
--- a/vtysh/vtysh_user.c
+++ b/vtysh/vtysh_user.c
@@ -102,7 +102,7 @@ struct list *userlist;
 static struct vtysh_user *
 user_new ()
 {
-  return XCALLOC (0, sizeof (struct vtysh_user));
+  return XCALLOC (MTYPE_TMP, sizeof (struct vtysh_user));
 }
 
 #if 0
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 1650dab..15b7015 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -218,7 +218,7 @@ nexthop_ifname_add (struct rib *rib, char *ifname)
 
   nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
   nexthop->type = NEXTHOP_TYPE_IFNAME;
-  nexthop->ifname = XSTRDUP (0, ifname);
+  nexthop->ifname = XSTRDUP (MTYPE_TMP, ifname);
 
   nexthop_add (rib, nexthop);
 
@@ -282,7 +282,7 @@ nexthop_ipv6_ifname_add (struct rib *rib, struct in6_addr 
*ipv6,
   nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
   nexthop->type = NEXTHOP_TYPE_IPV6_IFNAME;
   nexthop->gate.ipv6 = *ipv6;
-  nexthop->ifname = XSTRDUP (0, ifname);
+  nexthop->ifname = XSTRDUP (MTYPE_TMP, ifname);
 
   nexthop_add (rib, nexthop);
 
@@ -2460,7 +2460,7 @@ static_add_ipv4_safi (safi_t safi, struct prefix *p, 
struct in_addr *gate,
   if (gate)
     si->addr.ipv4 = *gate;
   if (ifname)
-    si->ifname = XSTRDUP (0, ifname);
+    si->ifname = XSTRDUP (MTYPE_TMP, ifname);
 
   /* Add new static route information to the tree with sort by
      distance value and gateway address. */
@@ -2857,11 +2857,11 @@ static_add_ipv6 (struct prefix *p, u_char type, struct 
in6_addr *gate,
       si->addr.ipv6 = *gate;
       break;
     case STATIC_IPV6_IFNAME:
-      si->ifname = XSTRDUP (0, ifname);
+      si->ifname = XSTRDUP (MTYPE_TMP, ifname);
       break;
     case STATIC_IPV6_GATEWAY_IFNAME:
       si->addr.ipv6 = *gate;
-      si->ifname = XSTRDUP (0, ifname);
+      si->ifname = XSTRDUP (MTYPE_TMP, ifname);
       break;
     }
 
diff --git a/zebra/zserv.c b/zebra/zserv.c
index e624ef2..46819f4 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -1312,7 +1312,7 @@ zebra_client_create (int sock)
   struct zserv *client;
   int i;
 
-  client = XCALLOC (0, sizeof (struct zserv));
+  client = XCALLOC (MTYPE_TMP, sizeof (struct zserv));
 
   /* Make client input/output buffer. */
   client->sock = sock;
-- 
2.3.6


_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to