mirror of
https://github.com/systemd/systemd.git
synced 2025-01-10 05:18:17 +03:00
make socket_instantiate_service use cleanup gcc attribute
This commit is contained in:
parent
ec260edc1c
commit
6c833cdfc3
@ -179,7 +179,8 @@ static int socket_arm_timer(Socket *s) {
|
||||
}
|
||||
|
||||
static int socket_instantiate_service(Socket *s) {
|
||||
char *prefix, *name;
|
||||
_cleanup_free_ char *prefix = NULL;
|
||||
_cleanup_free_ char *name = NULL;
|
||||
int r;
|
||||
Unit *u;
|
||||
|
||||
@ -199,13 +200,11 @@ static int socket_instantiate_service(Socket *s) {
|
||||
return -ENOMEM;
|
||||
|
||||
r = asprintf(&name, "%s@%u.service", prefix, s->n_accepted);
|
||||
free(prefix);
|
||||
|
||||
if (r < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
r = manager_load_unit(UNIT(s)->manager, name, NULL, NULL, &u);
|
||||
free(name);
|
||||
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user