summaryrefslogtreecommitdiff
path: root/src/core/socket.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-23 19:55:49 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-29 21:55:51 +0200
commit710a6b5017ba23fde6713f55340db5390ea27cec (patch)
tree34d5c96acc0439f898624a47a9dbfb12d21e957c /src/core/socket.c
parente8da24a642c78d55f5287011db70d7cd95bf3b2b (diff)
selinux: add _cleanup_ concepts to SELinux label allocation
Diffstat (limited to 'src/core/socket.c')
-rw-r--r--src/core/socket.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/core/socket.c b/src/core/socket.c
index c0c11e4f6a..55ecada5ee 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -1210,10 +1210,10 @@ fail:
}
static int socket_open_fds(Socket *s) {
+ _cleanup_(mac_selinux_freep) char *label = NULL;
+ bool know_label = false;
SocketPort *p;
int r;
- char *label = NULL;
- bool know_label = false;
assert(s);
@@ -1327,13 +1327,10 @@ static int socket_open_fds(Socket *s) {
assert_not_reached("Unknown port type");
}
- mac_selinux_free(label);
return 0;
rollback:
socket_close_fds(s);
- mac_selinux_free(label);
-
return r;
}