diff options
-rw-r--r-- | source3/libsmb/async_smb.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index e30435a225..c2986e25e9 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -275,6 +275,11 @@ NTSTATUS cli_smb_recv(struct tevent_req *req, } else { *pinbuf = inbuf; } + } else if (mem_ctx != NULL) { + if (talloc_reference_count(inbuf) == 0) { + (void)talloc_move(mem_ctx, &inbuf); + TALLOC_FREE(recv_iov); + } } return status; |