]> git.puffer.fish Git - mirror/frr.git/commitdiff
*: get rid of "MTYPE 0"
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 28 Jul 2016 15:23:49 +0000 (17:23 +0200)
committerDonald Sharp <sharpd@cumulusnetwroks.com>
Thu, 28 Jul 2016 11:27:48 +0000 (07:27 -0400)
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.

Acked-by: Vincent JARDIN <vincent.jardin@6wind.com>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
[DL: v2: fix XFREE(0, foo) calls too]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/prefix.c
ospfclient/ospf_apiclient.h
ospfd/ospf_opaque.c
ospfd/ospf_snmp.c
ospfd/ospf_te.c
vtysh/vtysh_main.c
vtysh/vtysh_user.c
zebra/zserv.c

index 256cd3a49a1508b99c23789007b3cb3191b07ce6..c311b94eef698592080d69388f26f10782c249d0 100644 (file)
@@ -572,7 +572,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);
index 0e74787ae094539da2ea235cf419da0f917fab86..809861995e1764c162b4833c6f3469737e94017f 100644 (file)
@@ -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
index 4c05c772522b907220095e37bcb91a232ab31f9f..ff505b6bd3ee1e3765de77355041a7a081d08521 100644 (file)
@@ -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>
 #ifdef HAVE_OPAQUE_LSA
index 0eaf44b4d2ac42782d8c7979e921b758a1ac7037..bedcb559bf5fa554d99b84cfde2df1d40042acc1 100644 (file)
@@ -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
index db06623ddfbe2789a5f2104b3def0146aca97326..155a773b33c12bdecc32d52793f97ae30a83e162 100644 (file)
@@ -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>
 
index cd21c94efdba32a05761df0979f46cd9c242d2fe..5bb3c61e523a67351638ada1fff7701adbd77a4f 100644 (file)
@@ -317,7 +317,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)
@@ -501,7 +501,7 @@ main (int argc, char **argv, char **env)
            struct cmd_rec *cr;
            cr = cmd;
            cmd = cmd->next;
-           XFREE(0, cr);
+           XFREE(MTYPE_TMP, cr);
          }
         }
 
index 0d72c378a31862fbb3732b36892091d733c6db10..988c768dcefbf3a84345d5b21cf5d0386ca18f41 100644 (file)
@@ -116,7 +116,7 @@ struct list *userlist;
 static struct vtysh_user *
 user_new (void)
 {
-  return XCALLOC (0, sizeof (struct vtysh_user));
+  return XCALLOC (MTYPE_TMP, sizeof (struct vtysh_user));
 }
 
 static struct vtysh_user *
index b36f8fe42538e3f63092dd3587a25c24f5e4817c..d625c02ff475f4db646dfa3fb5a31eace9fb3ec8 100644 (file)
@@ -1867,7 +1867,7 @@ zebra_client_close (struct zserv *client)
 
   /* Free client structure. */
   listnode_delete (zebrad.client_list, client);
-  XFREE (0, client);
+  XFREE (MTYPE_TMP, client);
 }
 
 /* Make new client. */
@@ -1878,7 +1878,7 @@ zebra_client_create (int sock)
   int i;
   afi_t afi;
 
-  client = XCALLOC (0, sizeof (struct zserv));
+  client = XCALLOC (MTYPE_TMP, sizeof (struct zserv));
 
   /* Make client input/output buffer. */
   client->sock = sock;