chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22927a3
)
util: properly handle OOM when allocating Debian version string
author
Lennart Poettering
<lennart@poettering.net>
Tue, 21 Dec 2010 09:05:20 +0000
(14:35 +0530)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 21 Dec 2010 09:05:20 +0000
(14:35 +0530)
src/util.c
patch
|
blob
|
history
diff --git
a/src/util.c
b/src/util.c
index d12b5e772da601b9379e0c0efde09481564d7a56..d769d60986f136d628d0eb0cfac21c3f9c478a35 100644
(file)
--- 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.");
}
}