Found by Coverity and asn ;)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
- if (cli_pipe && rpccli_is_connected(*cli_pipe)) {
- return NT_STATUS_OK;
- } else {
- TALLOC_FREE(*cli_pipe);
+ if (cli_pipe != NULL) {
+ if (rpccli_is_connected(*cli_pipe)) {
+ return NT_STATUS_OK;
+ } else {
+ TALLOC_FREE(*cli_pipe);
+ }
}
tmp_ctx = talloc_stackframe();
status = NT_STATUS_OK;
done:
- if (NT_STATUS_IS_OK(status)) {
+ if (NT_STATUS_IS_OK(status) && cli_pipe != NULL) {
*cli_pipe = talloc_move(mem_ctx, &cli);
}
TALLOC_FREE(tmp_ctx);