diff options
author | David Oberhollenzer <goliath@infraroot.at> | 2019-03-29 10:40:59 +0100 |
---|---|---|
committer | David Oberhollenzer <goliath@infraroot.at> | 2019-03-29 21:00:53 +0100 |
commit | c3d14cbfa863ea3af8aaa253f1d7d3909adf1547 (patch) | |
tree | 5b057f5fbdd0a28a6c5a9061c5907eb58f8e817f /lib/init | |
parent | 7cfe6e845878d67f578fa846e784c064a178d9c5 (diff) |
cleanup: init status response
- rename init_status_response_t to init_status_t
- merge code for handling it
- fix memory leak in status command
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
Diffstat (limited to 'lib/init')
-rw-r--r-- | lib/init/free_init_status.c | 10 | ||||
-rw-r--r-- | lib/init/init_socket_recv_status.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/init/free_init_status.c b/lib/init/free_init_status.c new file mode 100644 index 0000000..945d407 --- /dev/null +++ b/lib/init/free_init_status.c @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: ISC */ +#include <stdlib.h> + +#include "initsock.h" + +void free_init_status(init_status_t *resp) +{ + free(resp->filename); + free(resp->service_name); +} diff --git a/lib/init/init_socket_recv_status.c b/lib/init/init_socket_recv_status.c index b812819..d5ca2e6 100644 --- a/lib/init/init_socket_recv_status.c +++ b/lib/init/init_socket_recv_status.c @@ -61,7 +61,7 @@ static char *read_string(int fd) return buffer; } -int init_socket_recv_status(int fd, init_status_response_t *resp) +int init_socket_recv_status(int fd, init_status_t *resp) { uint8_t info[8]; |