summaryrefslogtreecommitdiff
path: root/lib/addns
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2019-07-09 14:50:24 +0000
committerGary Lockyer <gary@samba.org>2019-07-24 21:33:21 +0000
commitda4c1c5f39669274bf8ff5a0974b4111f80be798 (patch)
treea0ed1ec84fd42f1c0ce05707ef5628276139ddf5 /lib/addns
parent6baf0208eb85e834138f666153f94e8327e84996 (diff)
downloadsamba-da4c1c5f39669274bf8ff5a0974b4111f80be798.tar.gz
lib/addns: clang: Fix 'Value stored to 'err' is never read'
Fixes: /home/samba/samba/lib/addns/dnsmarshall.c:406:2: warning: Value stored to 'err' is never read <--[clang] err = ERROR_DNS_NO_MEMORY; ^ ~~~~~~~~~~~~~~~~~~~ /home/samba/samba/lib/addns/dnsmarshall.c:447:3: warning: Value stored to 'err' is never read <--[clang] err = buf->error; ^ ~~~~~~~~~~ 2 warnings generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib/addns')
-rw-r--r--lib/addns/dnsmarshall.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/addns/dnsmarshall.c b/lib/addns/dnsmarshall.c
index 3205786cbbb..a07ed784ce1 100644
--- a/lib/addns/dnsmarshall.c
+++ b/lib/addns/dnsmarshall.c
@@ -388,10 +388,10 @@ DNS_ERROR dns_unmarshall_request(TALLOC_CTX *mem_ctx,
{
struct dns_request *req;
uint16_t i;
- DNS_ERROR err;
+ DNS_ERROR err = ERROR_DNS_NO_MEMORY;
if (!(req = talloc_zero(mem_ctx, struct dns_request))) {
- return ERROR_DNS_NO_MEMORY;
+ return err;
}
dns_unmarshall_uint16(buf, &req->id);
@@ -401,7 +401,10 @@ DNS_ERROR dns_unmarshall_request(TALLOC_CTX *mem_ctx,
dns_unmarshall_uint16(buf, &req->num_auths);
dns_unmarshall_uint16(buf, &req->num_additionals);
- if (!ERR_DNS_IS_OK(buf->error)) goto error;
+ if (!ERR_DNS_IS_OK(buf->error)){
+ err = buf->error;
+ goto error;
+ }
err = ERROR_DNS_NO_MEMORY;
@@ -452,7 +455,6 @@ DNS_ERROR dns_unmarshall_request(TALLOC_CTX *mem_ctx,
return ERROR_DNS_SUCCESS;
error:
- err = buf->error;
TALLOC_FREE(req);
return err;
}