From 335a529947c34663f416ab644ae4a2c5ab34fec7 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sun, 31 May 2020 10:56:49 +0200 Subject: [PATCH] Don't overallocate memory in attrs_from_List() Allocate ``(strlen + 1) * sizeof(char)`` instead of ``(strlen + 1) * sizeof(char*)`` for a ``char[]`` in ``attrs_from_List()``. Signed-off-by: Christian Heimes --- Modules/LDAPObject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/LDAPObject.c b/Modules/LDAPObject.c index ed4df4c0..c331718f 100644 --- a/Modules/LDAPObject.c +++ b/Modules/LDAPObject.c @@ -335,7 +335,7 @@ attrs_from_List(PyObject *attrlist, char ***attrsp) * internal values that must be treated like const char. Python * 3.7 actually returns a const char. */ - attrs[i] = (char *)PyMem_NEW(char *, strlen + 1); + attrs[i] = (char *)PyMem_NEW(char, strlen + 1); if (attrs[i] == NULL) goto nomem; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy