]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common source file changes not directly applicable to open-vm-tools.
authorOliver Kurth <okurth@vmware.com>
Fri, 6 Jul 2018 22:02:36 +0000 (15:02 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 6 Jul 2018 22:02:36 +0000 (15:02 -0700)
open-vm-tools/lib/include/util.h
open-vm-tools/lib/include/vm_product_versions.h
open-vm-tools/lib/misc/utilMem.c

index 3e2d44130e1a231b30860a7b97b0b4e11475d764..9281609c330edf85962a8e2fa66fe509d6dfda77 100644 (file)
@@ -302,6 +302,7 @@ char *UtilSafeStrndup1(const char *s, size_t n,
 
 void *Util_Memdup(const void *src, size_t size);
 void *Util_Memcpy(void *dest, const void *src, size_t count);
+void  Util_Memfree(void *ptr);
 
 Bool Util_ConstTimeMemDiff(const void *secret, const void *guess, size_t len);
 Bool Util_ConstTimeStrDiff(const char *secret, const char *guess);
index e5fb41fe7938789c30c0f1d0640ba703d8e8cf4b..87d20c28562553d8f9c368e0e5dd0e3e8e338c3a 100644 (file)
  * a parameter that no longer match the content of the dormant license
  * file.
  */
-#define PRODUCT_MAC_DESKTOP_VERSION_STRING_FOR_LICENSE "10.0"
+#define PRODUCT_MAC_DESKTOP_VERSION_STRING_FOR_LICENSE "11.0"
 #define PRODUCT_PLAYER_VERSION_STRING_FOR_LICENSE "14.0"
 #define PRODUCT_VMRC_VERSION_STRING_FOR_LICENSE "10.0"
 #define PRODUCT_FLEX_VERSION_STRING_FOR_LICENSE "8.0"
index 6a288a0d3f014d03ec6b2f950f952f2aad6f5232..2ad5926d69eacb4a51cc130f1b803030302a3bb8 100644 (file)
@@ -488,6 +488,39 @@ Util_Memcpy(void *dest,      // OUT:
 }
 
 
+/*
+ *-----------------------------------------------------------------------------
+ *
+ * Util_Memfree --
+ *
+ *      Frees the memory space pointed to by ptr.
+ *
+ *      The reason why this function is externally visible (not static)
+ *      is to avoid freeing memory across dll boundary.
+ *      In vmwarebase, we have many API that return newly allocated memory
+ *      to the caller. If the caller linked against a different msvc runtime
+ *      (for example, vmrest linked against msvcrt.dll), we will crash.
+ *      Using Util_Memfree() can avoid this kind of problem, since it sits
+ *      inside vmwarebase too. It will call the right free(), the one that
+ *      match the malloc() used in vmwarebase.
+ *
+ * Results:
+ *      The memory space pointed to by ptr will be freed.
+ *      If ptr is NULL, no operation is performed.
+ *
+ * Side effects:
+ *      None.
+ *
+ *-----------------------------------------------------------------------------
+ */
+
+void
+Util_Memfree(void *ptr) // IN:
+{
+   free(ptr);
+}
+
+
 /*
  *-----------------------------------------------------------------------------
  *