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 <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2016-06-04 21:15:16 +02:00
parent 662f364d09
commit 34d8848b5c
+5 -1
View File
@@ -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;