diff options
author | Amitay Isaacs <amitay@gmail.com> | 2018-12-18 11:33:30 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2018-12-18 07:12:09 +0100 |
commit | 1e061ff1e3fcfcd020df1a35c1c0697c114cb209 (patch) | |
tree | c013c55bc1790adc08d55df137fec37a3171e7a7 /ctdb/tools | |
parent | 1ed91f0e102e3cb67b69e146b8b587e4d0222a8a (diff) | |
download | samba-1e061ff1e3fcfcd020df1a35c1c0697c114cb209.tar.gz |
ctdb-tool: Avoid data uninitialized warnings
../../tools/ctdb.c: In function 'str_to_data':
../../tools/ctdb.c:624: warning: 'data.dsize' may be used uninitialized in this function
../../tools/ctdb.c:624: warning: 'data.dptr' may be used uninitialized in this function
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/tools')
-rw-r--r-- | ctdb/tools/ctdb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index b598a866c9b..eb4c684e8b0 100644 --- a/ctdb/tools/ctdb.c +++ b/ctdb/tools/ctdb.c @@ -626,6 +626,9 @@ static int str_to_data(const char *str, size_t len, TALLOC_CTX *mem_ctx, if (strncmp(str, "0x", 2) == 0) { ret = hex_to_data(str+2, len-2, mem_ctx, &data); + if (ret != 0) { + return ret; + } } else { data.dptr = talloc_memdup(mem_ctx, str, len); if (data.dptr == NULL) { @@ -635,7 +638,7 @@ static int str_to_data(const char *str, size_t len, TALLOC_CTX *mem_ctx, } *out = data; - return ret; + return 0; } static int run_helper(TALLOC_CTX *mem_ctx, const char *command, |