chiark / gitweb /
bus: remove unused check
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 23 Sep 2014 19:34:21 +0000 (21:34 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 23 Sep 2014 19:39:36 +0000 (21:39 +0200)
strerror_r does not return null here and even if it did we would have
problems already at the preceding strlen call.

Found by coverity. Fixes: CID#1237770

src/libsystemd/sd-bus/bus-error.c

index c2e41fb01676de2e7e79c7b4b9276af042a0e4f5..abdfd73204f79f6eacd769f771aaa4bd38d2fd5a 100644 (file)
@@ -312,7 +312,7 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
                         continue;
                 }
 
-                if (!x || errno) {
+                if (errno) {
                         free(m);
                         return;
                 }