From 34d8848b5cddf5da14200ce6a5e454bdee2d083d Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 4 Jun 2016 21:15:16 +0200 Subject: [PATCH] Fix leak if fallback shell cannot be registered If we cannot register a fallback TTY we leak a few bytes RAM. Found by Coverity Scan. Signed-off-by: Joachim Nilsson --- conf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/conf.c b/conf.c index 4d5b289a..9f422b85 100644 --- a/conf.c +++ b/conf.c @@ -530,7 +530,11 @@ int conf_parse_config(void) else fallback = strdup(FALLBACK_SHELL); - tty_register(fallback); + if (tty_register(fallback)) { + free(fallback); + if (console) + console = NULL; + } } return result;