You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
678 B

Index: SWIG/_aes.i
===================================================================
--- SWIG/_aes.i (revision 724)
+++ SWIG/_aes.i (working copy)
@@ -64,6 +64,7 @@
const void *buf;
Py_ssize_t len;
unsigned char *out;
+ PyObject *res;
if (PyObject_AsReadBuffer(in, &buf, &len) == -1)
return NULL;
@@ -76,7 +77,9 @@
AES_encrypt((const unsigned char *)in, out, key);
else
AES_decrypt((const unsigned char *)in, out, key);
- return PyString_FromStringAndSize((char*)out, outlen);
+ res = PyString_FromStringAndSize((char*)out, outlen);
+ PyMem_Free(out);
+ return res;
}
int AES_type_check(AES_KEY *key) {