summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorVladimír Čunát <vladimir.cunat@nic.cz>2019-06-24 14:34:17 +0200
committerVladimír Čunát <vladimir.cunat@nic.cz>2019-06-24 16:03:37 +0200
commit94dc55afec9494601a0f88b74a4b78841f379df5 (patch)
tree6cf16eb07667e5b462e8769cd2da0352589b037e /modules
parentmodules/sd_watchdog nitpick: detect more errors (diff)
downloadknot-resolver-94dc55afec9494601a0f88b74a4b78841f379df5.tar.xz
knot-resolver-94dc55afec9494601a0f88b74a4b78841f379df5.zip
modules/sd_watchdog nitpicks: simplify
Diffstat (limited to 'modules')
-rw-r--r--modules/sd_watchdog/sd_watchdog.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/modules/sd_watchdog/sd_watchdog.c b/modules/sd_watchdog/sd_watchdog.c
index 95981446..bdf6f51f 100644
--- a/modules/sd_watchdog/sd_watchdog.c
+++ b/modules/sd_watchdog/sd_watchdog.c
@@ -23,16 +23,10 @@ static void keepalive_ping(uv_timer_t *timer)
KR_EXPORT
int sd_watchdog_init(struct kr_module *module)
{
- static kr_layer_api_t layer = { 0 };
- layer.data = module;
- module->layer = &layer;
- module->props = NULL;
-
- struct watchdog_config *conf = malloc(sizeof(*conf));
+ struct watchdog_config *conf = calloc(1, sizeof(*conf));
if (!conf) {
return kr_error(ENOMEM);
}
- memset(conf, 0, sizeof(*conf));
module->data = conf;
/* Check if watchdog is enabled */