Rob Shearman : rpcrt4: Free the base pointer in PointerFree when freeing a pointer with RPC_FC_P_DEREF .

Alexandre Julliard julliard at winehq.org
Fri Dec 14 07:39:36 CST 2007


Module: wine
Branch: master
Commit: ce220e2b5f17b6b3698d5731b317f4c729b8076f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ce220e2b5f17b6b3698d5731b317f4c729b8076f

Author: Rob Shearman <rob at codeweavers.com>
Date:   Thu Dec 13 16:13:20 2007 +0000

rpcrt4: Free the base pointer in PointerFree when freeing a pointer with RPC_FC_P_DEREF.

---

 dlls/rpcrt4/ndr_marshall.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/rpcrt4/ndr_marshall.c b/dlls/rpcrt4/ndr_marshall.c
index b57f0a3..bd5c81d 100644
--- a/dlls/rpcrt4/ndr_marshall.c
+++ b/dlls/rpcrt4/ndr_marshall.c
@@ -1245,6 +1245,7 @@ static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
   unsigned type = pFormat[0], attr = pFormat[1];
   PFORMAT_STRING desc;
   NDR_FREE m;
+  unsigned char *current_pointer = Pointer;
 
   TRACE("(%p,%p,%p)\n", pStubMsg, Pointer, pFormat);
   TRACE("type=0x%x, attr=", type); dump_pointer_attr(attr);
@@ -1263,12 +1264,12 @@ static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
   }
 
   if (attr & RPC_FC_P_DEREF) {
-    Pointer = *(unsigned char**)Pointer;
-    TRACE("deref => %p\n", Pointer);
+    current_pointer = *(unsigned char**)Pointer;
+    TRACE("deref => %p\n", current_pointer);
   }
 
   m = NdrFreer[*desc & NDR_TABLE_MASK];
-  if (m) m(pStubMsg, Pointer, desc);
+  if (m) m(pStubMsg, current_pointer, desc);
 
   /* this check stops us from trying to free buffer memory. we don't have to
    * worry about clients, since they won't call this function.




More information about the wine-cvs mailing list