summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-12-21 14:35:20 +0530
committerLennart Poettering <lennart@poettering.net>2010-12-21 14:35:20 +0530
commitc8bffa43fda412fa23bcf2b317a2bbfdf51f6473 (patch)
tree232fd9f892031d48ddf98b56b04ca4f51220eb93
parent22927a3654915670c6d2c7f2e60ea5f54cd2503d (diff)
util: properly handle OOM when allocating Debian version string
-rw-r--r--src/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index d12b5e772d..d769d60986 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3048,6 +3048,7 @@ void status_welcome(void) {
if (!pretty_name) {
char *version;
+
if ((r = read_one_line_file("/etc/debian_version", &version)) < 0) {
if (r != -ENOENT)
@@ -3056,6 +3057,9 @@ void status_welcome(void) {
truncate_nl(version);
pretty_name = strappend("Debian ", version);
free(version);
+
+ if (!pretty_name)
+ log_warning("Failed to allocate Debian version string.");
}
}