Index: /trunk/src/VBox/Runtime/common/checksum/RTSha1Digest.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/checksum/RTSha1Digest.cpp	(revision 29818)
+++ /trunk/src/VBox/Runtime/common/checksum/RTSha1Digest.cpp	(revision 29819)
@@ -90,8 +90,14 @@
         return VERR_INTERNAL_ERROR;
 
-    *ppszDigest = (char*)RTMemAlloc(41);
-    rc = RTSha1ToString(auchDig, *ppszDigest, 41);
-    if (RT_FAILURE(rc))
-        RTStrFree(*ppszDigest);
+    char *pszDigest;
+    rc = RTStrAllocEx(&pszDigest, RTSHA1_DIGEST_LEN + 1);
+    if (RT_SUCCESS(rc))
+    {
+        rc = RTSha1ToString(auchDig, pszDigest, RTSHA1_DIGEST_LEN + 1);
+        if (RT_SUCCESS(rc))
+            *ppszDigest = pszDigest;
+        else
+            RTStrFree(pszDigest);
+    }
 
     return rc;
