From 5d95312fb8eb1684879b9fb8c5c928089326d0df Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Thu, 8 Nov 2018 02:45:00 -0700 Subject: [PATCH] Replace dead code with an assertion in winreg.c. (GH-10028) --- PC/winreg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PC/winreg.c b/PC/winreg.c index 4f5a676f10b..c6ad7ab64e1 100644 --- a/PC/winreg.c +++ b/PC/winreg.c @@ -651,8 +651,7 @@ Py2Reg(PyObject *value, DWORD typ, BYTE **retDataBuf, DWORD *retDataSize) t = PyList_GET_ITEM(value, j); wstr = PyUnicode_AsUnicodeAndSize(t, &len); - if (wstr == NULL) - return FALSE; + assert(wstr); wcscpy(P, wstr); P += (len + 1); }