s3:libsmb: don't require a pinbuf in cli_smb_recv() to keep the memory
authorStefan Metzmacher <metze@samba.org>
Mon, 4 Jun 2012 13:53:52 +0000 (15:53 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 5 Jun 2012 15:33:49 +0000 (17:33 +0200)
metze

source3/libsmb/async_smb.c

index e30435a225bc4228fd26ed967105b9f59d342744..c2986e25e92cf6ebc11a9872b7b3be5047e843af 100644 (file)
@@ -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;