From 0ce1ca805d607cec2c0f75dac8950f40e75fc971 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 14 Jun 2018 08:58:05 -0400 Subject: *: ALLOC calls cannot fail There is no need to check for failure of a ALLOC call as that any failure to do so will result in a assert happening. So we can safely remove all of this code. Signed-off-by: Donald Sharp --- lib/command.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/command.c') diff --git a/lib/command.c b/lib/command.c index 0bf856f248..a98654dd23 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2409,11 +2409,7 @@ static int set_log_file(struct vty *vty, const char *fname, int loglevel) return CMD_WARNING_CONFIG_FAILED; } - if ((p = XMALLOC(MTYPE_TMP, strlen(cwd) + strlen(fname) + 2)) - == NULL) { - zlog_err("config_log_file: Unable to alloc mem!"); - return CMD_WARNING_CONFIG_FAILED; - } + p = XMALLOC(MTYPE_TMP, strlen(cwd) + strlen(fname) + 2); sprintf(p, "%s/%s", cwd, fname); fullpath = p; } else -- cgit v1.2.3