From 43239feb3864bef3b0218da12800e6f0d15f3a5d Mon Sep 17 00:00:00 2001 From: Matthew Bloch Date: Mon, 21 May 2012 03:59:43 +0100 Subject: [PATCH] Fixed some uninitialised variables courtesy of valgrind. --- flexnbd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flexnbd.c b/flexnbd.c index 5863c7e..71047ff 100644 --- a/flexnbd.c +++ b/flexnbd.c @@ -51,6 +51,8 @@ void params_serve( SERVER_ERROR("Couldn't parse server address '%s' (use 0 if " "you want to bind to all IPs)", s_ip_address); + out->control_socket_name = NULL; + if (acl_entries > 0 && s_acl_entries[0][0] == '/') { out->control_socket_name = s_acl_entries[0]; s_acl_entries++; @@ -131,6 +133,7 @@ void do_write(struct mode_readwrite_params* params); void mode(char* mode, int argc, char **argv) { union mode_params params; + memset(¶ms, 0, sizeof(params)); if (strcmp(mode, "serve") == 0) { if (argc >= 3) {