diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-19 18:04:26 -0700 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-19 18:04:26 -0700 |
| commit | 24873f0c06e6196a105f648e8fe29d19dcddd1de (patch) | |
| tree | f0ad6ae52390a9ed3b63c6fe228da30f5cf92d7b /lib/if_rmap.c | |
| parent | 0299c0042783463ee007a6dba0de70dcf6fc36ee (diff) | |
lib: lib-warnings.patch
Remove compile warnings for the lib directory
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by:
Diffstat (limited to 'lib/if_rmap.c')
| -rw-r--r-- | lib/if_rmap.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/if_rmap.c b/lib/if_rmap.c index e4a83de8bb..26a6d8c55b 100644 --- a/lib/if_rmap.c +++ b/lib/if_rmap.c @@ -64,10 +64,11 @@ if_rmap_lookup (const char *ifname) struct if_rmap *if_rmap; /* temporary copy */ - key.ifname = (char *)ifname; + key.ifname = XSTRDUP (MTYPE_IF_RMAP_NAME, ifname); if_rmap = hash_lookup (ifrmaphash, &key); + XFREE(MTYPE_IF_RMAP_NAME, key.ifname); return if_rmap; } @@ -86,7 +87,7 @@ if_rmap_hook_delete (void (*func) (struct if_rmap *)) static void * if_rmap_hash_alloc (void *arg) { - struct if_rmap *ifarg = arg; + struct if_rmap *ifarg = (struct if_rmap *)arg; struct if_rmap *if_rmap; if_rmap = if_rmap_new (); @@ -99,11 +100,16 @@ static struct if_rmap * if_rmap_get (const char *ifname) { struct if_rmap key; + struct if_rmap *ret; /* temporary copy */ - key.ifname = (char *)ifname; + key.ifname = XSTRDUP (MTYPE_IF_RMAP_NAME, ifname); - return (struct if_rmap *) hash_get (ifrmaphash, &key, if_rmap_hash_alloc); + ret = hash_get (ifrmaphash, &key, if_rmap_hash_alloc); + if (key.ifname) + XFREE(MTYPE_IF_RMAP_NAME, key.ifname); + + return ret; } static unsigned int |
