Issue #15728: Fix leak in PyUnicode_AsWideCharString(). Found by Coverity.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index d369861..773a9be 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -2935,8 +2935,10 @@
         return NULL;
     }
     buflen = unicode_aswidechar(unicode, buffer, buflen);
-    if (buflen == -1)
+    if (buflen == -1) {
+        PyMem_FREE(buffer);
         return NULL;
+    }
     if (size != NULL)
         *size = buflen;
     return buffer;