[systemd-commits] src/bus-proxyd
Thomas H.P. Andersen
phomes at kemper.freedesktop.org
Sun Sep 28 09:49:10 PDT 2014
src/bus-proxyd/test-bus-policy.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
New commits:
commit 5e90b6a978d15efedc5b5cc4a3d2d922a0ecd2a9
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date: Sun Sep 28 18:46:15 2014 +0200
test-bus-policy: silence coverity
Check if strjoin worked and also use _cleanup_free_ since we are
here.
Found with Coverity. Fixes CID#1241962
diff --git a/src/bus-proxyd/test-bus-policy.c b/src/bus-proxyd/test-bus-policy.c
index 900e4d2..7bcebef 100644
--- a/src/bus-proxyd/test-bus-policy.c
+++ b/src/bus-proxyd/test-bus-policy.c
@@ -46,18 +46,17 @@
static int test_policy_load(Policy *p, const char *name)
{
- char *path;
+ _cleanup_free_ char *path = NULL;
int r = 0;
path = strjoin(TEST_DIR, "/bus-policy/", name, NULL);
+ assert_se(path);
if (access(path, R_OK) == 0)
policy_load(p, STRV_MAKE(path));
else
r = -ENOENT;
- free(path);
-
return r;
}
More information about the systemd-commits
mailing list