Skip to content

Commit f789465

Browse files
committed
Silence a gcc "may be used uninitialized" compiler warning. Not true.
Initializing retval prevents the naive warning.
1 parent 9afe8a3 commit f789465

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/pystrhex.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
1818
retbuf = (Py_UCS1*) PyMem_Malloc(arglen*2);
1919
if (!retbuf)
2020
return PyErr_NoMemory();
21+
retval = NULL; /* silence a compiler warning, assigned later. */
2122
} else {
2223
retval = PyUnicode_New(arglen*2, 127);
2324
if (!retval)

0 commit comments

Comments
 (0)