diff options
Diffstat (limited to 'gluster-blockd.c')
-rw-r--r-- | gluster-blockd.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gluster-blockd.c b/gluster-blockd.c index ef27dbd..9d1ace8 100644 --- a/gluster-blockd.c +++ b/gluster-blockd.c @@ -118,13 +118,14 @@ glusterBlockCallRPC_1(char *host, void *cobj, ret = reply->exit; out: - if (!clnt_freeres(clnt, (xdrproc_t)xdr_blockResponse, (char *)reply)) { - LOG("mgmt", GB_LOG_ERROR, "%s", - clnt_sperror(clnt, "clnt_freeres failed")); - } - if (clnt) { - clnt_destroy (clnt); + if (!reply || + !clnt_freeres(clnt, (xdrproc_t)xdr_blockResponse, (char *)reply)) { + LOG("mgmt", GB_LOG_ERROR, "%s", + clnt_sperror(clnt, "clnt_freeres failed")); + + clnt_destroy (clnt); + } } close(sockfd); |