libcli/raw: give the caller the chance to prevent the talloc_free(req) in the _recv...
authorStefan Metzmacher <metze@samba.org>
Tue, 9 Sep 2008 15:50:30 +0000 (17:50 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 9 Sep 2008 19:11:23 +0000 (21:11 +0200)
metze

source/libcli/raw/libcliraw.h
source/libcli/raw/rawrequest.c

index d55b4cc42c160f341913e274d391d975bcc8322b..c9cafedd4c9105f9d7293de76c54fa0c819cad58 100644 (file)
@@ -261,6 +261,9 @@ struct smbcli_request {
           counter by one */
        uint_t sign_single_increment:1;
 
+       /* give the caller a chance to prevent the talloc_free() in the _recv() function */
+       bool do_not_free;
+
        /* the mid of this packet - used to match replies */
        uint16_t mid;
 
index a0e6452748e0f0a4bb0c4056061597aa34423d8a..dd9b1f3e963c76014534a332398c7bcf148ce96c 100644 (file)
@@ -72,7 +72,11 @@ _PUBLIC_ NTSTATUS smbcli_request_destroy(struct smbcli_request *req)
        }
 
        status = req->status;
-       talloc_free(req);
+
+       if (!req->do_not_free) {
+               talloc_free(req);
+       }
+
        return status;
 }