fixed rpc smb code to not reply on talloc_free being a function pointer
authorAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 03:59:52 +0000 (13:59 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 1 Jul 2009 05:15:36 +0000 (15:15 +1000)
The upcoming talloc_free/talloc_reference changes change talloc_free
to be a macro. These two bits of code relied on it being a function
pointer

source4/librpc/rpc/dcerpc_smb.c
source4/librpc/rpc/dcerpc_smb2.c

index 013a8578e670e299a7fab3764ad6b8a8f8f478ca..8b221747aca1532daf92c64a0cc9863a11f06794 100644 (file)
@@ -360,6 +360,12 @@ static NTSTATUS smb_send_request(struct dcerpc_connection *c, DATA_BLOB *blob,
        return NT_STATUS_OK;
 }
 
+
+static void free_request(struct smbcli_request *req)
+{
+       talloc_free(req);
+}
+
 /* 
    shutdown SMB pipe connection
 */
@@ -378,7 +384,7 @@ static NTSTATUS smb_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status)
        req = smb_raw_close_send(smb->tree, &io);
        if (req != NULL) {
                /* we don't care if this fails, so just free it if it succeeds */
-               req->async.fn = (void (*)(struct smbcli_request *))talloc_free;
+               req->async.fn = free_request;
        }
 
        talloc_free(smb);
index e4933652f44f219aac3e187ae401b981629a188d..fbd847680f7743520a35b4c37d162ff25b1f06b7 100644 (file)
@@ -324,6 +324,11 @@ static NTSTATUS smb2_send_request(struct dcerpc_connection *c, DATA_BLOB *blob,
        return NT_STATUS_OK;
 }
 
+static void free_request(struct smb2_request *req)
+{
+       talloc_free(req);
+}
+
 /* 
    shutdown SMB pipe connection
 */
@@ -341,7 +346,7 @@ static NTSTATUS smb2_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status)
        req = smb2_close_send(smb->tree, &io);
        if (req != NULL) {
                /* we don't care if this fails, so just free it if it succeeds */
-               req->async.fn = (void (*)(struct smb2_request *))talloc_free;
+               req->async.fn = free_request;
        }
 
        talloc_free(smb);