diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-02-04 13:19:37 -0500 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2020-02-04 13:19:37 -0500 |
| commit | e1b36e132b7eda2d230f2f95945e231df37a42f5 (patch) | |
| tree | 8a40165810e2ddc3f3d3ca0709134554b766b5ca /lib | |
| parent | b3ba5dc7fe769f3719b2812e4fdb9f8f8271032d (diff) | |
*: remove null check before XFREE
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bfd.c | 4 | ||||
| -rw-r--r-- | lib/command.c | 3 | ||||
| -rw-r--r-- | lib/filter.c | 4 | ||||
| -rw-r--r-- | lib/plist.c | 4 | ||||
| -rw-r--r-- | lib/vty.c | 9 |
5 files changed, 6 insertions, 18 deletions
@@ -74,9 +74,7 @@ struct bfd_info *bfd_info_create(void) */ void bfd_info_free(struct bfd_info **bfd_info) { - if (*bfd_info) { - XFREE(MTYPE_BFD_INFO, *bfd_info); - } + XFREE(MTYPE_BFD_INFO, *bfd_info); } /* diff --git a/lib/command.c b/lib/command.c index 05bb665657..8811b3a791 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2659,8 +2659,7 @@ int cmd_banner_motd_file(const char *file) void cmd_banner_motd_line(const char *line) { - if (host.motd) - XFREE(MTYPE_HOST, host.motd); + XFREE(MTYPE_HOST, host.motd); host.motd = XSTRDUP(MTYPE_HOST, line); } diff --git a/lib/filter.c b/lib/filter.c index e7a225961f..4521cf6469 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -608,9 +608,7 @@ static int vty_access_list_remark_unset(struct vty *vty, afi_t afi, return CMD_WARNING_CONFIG_FAILED; } - if (access->remark) { - XFREE(MTYPE_TMP, access->remark); - } + XFREE(MTYPE_TMP, access->remark); if (access->head == NULL && access->tail == NULL) access_list_delete(access); diff --git a/lib/plist.c b/lib/plist.c index 971fc62164..f6ceba81e8 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -1092,9 +1092,7 @@ static int vty_prefix_list_desc_unset(struct vty *vty, afi_t afi, return CMD_WARNING_CONFIG_FAILED; } - if (plist->desc) { - XFREE(MTYPE_TMP, plist->desc); - } + XFREE(MTYPE_TMP, plist->desc); if (plist->head == NULL && plist->tail == NULL && plist->desc == NULL) prefix_list_delete(plist); @@ -3011,13 +3011,8 @@ void vty_reset(void) vty_timeout_val = VTY_TIMEOUT_DEFAULT; - if (vty_accesslist_name) { - XFREE(MTYPE_VTY, vty_accesslist_name); - } - - if (vty_ipv6_accesslist_name) { - XFREE(MTYPE_VTY, vty_ipv6_accesslist_name); - } + XFREE(MTYPE_VTY, vty_accesslist_name); + XFREE(MTYPE_VTY, vty_ipv6_accesslist_name); } static void vty_save_cwd(void) |
