summaryrefslogtreecommitdiffstats
path: root/lib/if_rmap.c
diff options
context:
space:
mode:
authorpaul <paul>2005-10-26 05:05:16 +0000
committerpaul <paul>2005-10-26 05:05:16 +0000
commit2bddb1c5ef7a3e5af779b8f7731991a4cd941ee7 (patch)
treec8f6cdf638379e3b0ae924c9df08f67ac5966887 /lib/if_rmap.c
parent47b6988fecb5e4a9986dc091b5cd60f466fa8189 (diff)
downloadquagga-2bddb1c5ef7a3e5af779b8f7731991a4cd941ee7.tar.bz2
quagga-2bddb1c5ef7a3e5af779b8f7731991a4cd941ee7.tar.xz
2005-10-26 Paul Jakma <paul.jakma@sun.com>
* (general) Cleanup a some calls to XFREE,strdup, etc. to use the memory.h macros. * memtypes.c: Add MTYPE_IF_RMAP_NAME, MTYPE_PQUEUE, MTYPE_PQUEUE_DATA and MTYPE_HOST. * memtypes.h: update auto-built file. * if_rmap.c: Use MTYPE_IF_RMAP_NAME. * pqueue.c: Use the two MTYPE_PQUEUE mtypes for allocations.
Diffstat (limited to 'lib/if_rmap.c')
-rw-r--r--lib/if_rmap.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/if_rmap.c b/lib/if_rmap.c
index 6730e94c..e6f753c2 100644
--- a/lib/if_rmap.c
+++ b/lib/if_rmap.c
@@ -47,12 +47,12 @@ static void
if_rmap_free (struct if_rmap *if_rmap)
{
if (if_rmap->ifname)
- free (if_rmap->ifname);
+ XFREE (MTYPE_IF_RMAP_NAME, if_rmap->ifname);
if (if_rmap->routemap[IF_RMAP_IN])
- free (if_rmap->routemap[IF_RMAP_IN]);
+ XFREE (MTYPE_IF_RMAP_NAME, if_rmap->routemap[IF_RMAP_IN]);
if (if_rmap->routemap[IF_RMAP_OUT])
- free (if_rmap->routemap[IF_RMAP_OUT]);
+ XFREE (MTYPE_IF_RMAP_NAME, if_rmap->routemap[IF_RMAP_OUT]);
XFREE (MTYPE_IF_RMAP, if_rmap);
}
@@ -90,7 +90,7 @@ if_rmap_hash_alloc (void *arg)
struct if_rmap *if_rmap;
if_rmap = if_rmap_new ();
- if_rmap->ifname = strdup (ifarg->ifname);
+ if_rmap->ifname = XSTRDUP (MTYPE_IF_RMAP_NAME, ifarg->ifname);
return if_rmap;
}
@@ -140,14 +140,16 @@ if_rmap_set (const char *ifname, enum if_rmap_type type,
if (type == IF_RMAP_IN)
{
if (if_rmap->routemap[IF_RMAP_IN])
- free (if_rmap->routemap[IF_RMAP_IN]);
- if_rmap->routemap[IF_RMAP_IN] = strdup (routemap_name);
+ XFREE (MTYPE_IF_RMAP_NAME, if_rmap->routemap[IF_RMAP_IN]);
+ if_rmap->routemap[IF_RMAP_IN]
+ = XSTRDUP (MTYPE_IF_RMAP_NAME, routemap_name);
}
if (type == IF_RMAP_OUT)
{
if (if_rmap->routemap[IF_RMAP_OUT])
- free (if_rmap->routemap[IF_RMAP_OUT]);
- if_rmap->routemap[IF_RMAP_OUT] = strdup (routemap_name);
+ XFREE (MTYPE_IF_RMAP_NAME, if_rmap->routemap[IF_RMAP_OUT]);
+ if_rmap->routemap[IF_RMAP_OUT]
+ = XSTRDUP (MTYPE_IF_RMAP_NAME, routemap_name);
}
if (if_rmap_add_hook)
@@ -173,7 +175,7 @@ if_rmap_unset (const char *ifname, enum if_rmap_type type,
if (strcmp (if_rmap->routemap[IF_RMAP_IN], routemap_name) != 0)
return 0;
- free (if_rmap->routemap[IF_RMAP_IN]);
+ XFREE (MTYPE_IF_RMAP_NAME, if_rmap->routemap[IF_RMAP_IN]);
if_rmap->routemap[IF_RMAP_IN] = NULL;
}
@@ -184,7 +186,7 @@ if_rmap_unset (const char *ifname, enum if_rmap_type type,
if (strcmp (if_rmap->routemap[IF_RMAP_OUT], routemap_name) != 0)
return 0;
- free (if_rmap->routemap[IF_RMAP_OUT]);
+ XFREE (MTYPE_IF_RMAP_NAME, if_rmap->routemap[IF_RMAP_OUT]);
if_rmap->routemap[IF_RMAP_OUT] = NULL;
}