Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 865d12a

Browse files
committed
Fix warning: ‘ptr2’ may be used uninitialized in this function
1 parent 1d7ec8f commit 865d12a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Modules/_testcapimodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,6 +2723,7 @@ test_setallocators(PyMemAllocatorDomain domain)
27232723
case PYMEM_DOMAIN_RAW: ptr2 = PyMem_RawRealloc(ptr, size2); break;
27242724
case PYMEM_DOMAIN_MEM: ptr2 = PyMem_Realloc(ptr, size2); break;
27252725
case PYMEM_DOMAIN_OBJ: ptr2 = PyObject_Realloc(ptr, size2); break;
2726+
default: ptr2 = NULL; break;
27262727
}
27272728

27282729
if (ptr2 == NULL) {

0 commit comments

Comments
 (0)