Unit *u;
char *prefix, *instance, *name;
- if ((r = instance_from_socket(cfd, s->n_accepted++, &instance)))
+ if ((r = instance_from_socket(cfd, s->n_accepted++, &instance)) < 0)
goto fail;
if (!(prefix = unit_name_to_prefix(UNIT(s)->meta.id))) {
free(prefix);
free(instance);
- if (!name)
+ if (!name) {
r = -ENOMEM;
+ goto fail;
+ }
r = manager_load_unit(UNIT(s)->meta.manager, name, NULL, &u);
free(name);
if (r < 0)
goto fail;
- if ((r = service_set_socket_fd(SERVICE(u), cfd) < 0))
+ if ((r = service_set_socket_fd(SERVICE(u), cfd)) < 0)
goto fail;
cfd = -1;