I use ctypes to call a c function
void *crypto_data(void *buffer, int length, int *encrypt_len)
{
void *encrypt = malloc(length+25);
...
*encrypt_len = length + 25;
return encrypt;
}
lib.crypto_data.argtypes = [c_void_p, c_int, c_void_p]
lib.crypto_data.restype = c_void_p
my_len = c_int()
out_buffer = c_int()
out_buffer = lib.crypto_data(gzip_data, len(gzip_data), byref(my_len))
print out_buffer #this out_buffer is the address of malloc
how do I create bytearray from this malloced memory?