diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-06-19 16:17:09 -0400 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2018-08-11 19:58:23 +0200 |
| commit | 131437016632929f3a31f45bfe934b9b43235c71 (patch) | |
| tree | 849f5e4ab9d5ba954d3969a4876444133a3abc4d /tests/lib/test_heavy_thread.c | |
| parent | 5cecdba9d1915d8eeb6d7c17dd4366a3f15d9f3f (diff) | |
tests: Cleanup assumption that ALLOC could fail.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'tests/lib/test_heavy_thread.c')
| -rw-r--r-- | tests/lib/test_heavy_thread.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/tests/lib/test_heavy_thread.c b/tests/lib/test_heavy_thread.c index 075bcb6daf..b3c6e4c2f7 100644 --- a/tests/lib/test_heavy_thread.c +++ b/tests/lib/test_heavy_thread.c @@ -110,16 +110,9 @@ DEFUN (clear_foo, str = argv_concat(argv, argc, 0); - if ((ws = XMALLOC(MTYPE_TMP, sizeof(*ws))) == NULL) { - zlog_err("%s: unable to allocate work_state", __func__); - return CMD_WARNING; - } + ws = XMALLOC(MTYPE_TMP, sizeof(*ws)); - if (!(ws->str = XSTRDUP(MTYPE_TMP, str))) { - zlog_err("%s: unable to xstrdup", __func__); - XFREE(MTYPE_TMP, ws); - return CMD_WARNING; - } + ws->str = XSTRDUP(MTYPE_TMP, str); ws->vty = vty; ws->i = ITERS_FIRST; |
