Check if strjoin worked and also use _cleanup_free_ since we are
here.
Found with Coverity. Fixes CID#
1241962
static int test_policy_load(Policy *p, const char *name)
{
static int test_policy_load(Policy *p, const char *name)
{
+ _cleanup_free_ char *path = NULL;
int r = 0;
path = strjoin(TEST_DIR, "/bus-policy/", name, NULL);
int r = 0;
path = strjoin(TEST_DIR, "/bus-policy/", name, NULL);
if (access(path, R_OK) == 0)
policy_load(p, STRV_MAKE(path));
else
r = -ENOENT;
if (access(path, R_OK) == 0)
policy_load(p, STRV_MAKE(path));
else
r = -ENOENT;