|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From b1604b341bcd190d67894f416d842990a082a4a4 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: Andreas Henriksson <andreas@fatal.se>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Thu, 18 Sep 2014 17:52:54 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] journal-remote: check return code of sd_event_default
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Handle sd_event_default returning error and bail out properly
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
as done in every other caller of this function.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Found by coverity. Fixes: CID#1238957
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/journal-remote/journal-remote.c | 6 +++++-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 5 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 12de820330..f06c2cb249 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/journal-remote/journal-remote.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/journal-remote/journal-remote.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -808,7 +808,11 @@ static int remoteserver_init(RemoteServer *s,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return -EINVAL;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- sd_event_default(&s->events);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ r = sd_event_default(&s->events);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ log_error("Failed to allocate event loop: %s", strerror(-r));
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ return r;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
setup_signals(s);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|