mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 13:36:30 +03:00
fix(python): free allocated string pointers (#393)
* fix(python): free allocated string pointers * Update python/src/deltachat/cutil.py Co-Authored-By: holger krekel <holger@merlinux.eu> * Update cutil.py * probably the proper way to handle ffi.strings
This commit is contained in:
committed by
holger krekel
parent
6b2fe03d08
commit
8c10aa287c
@@ -142,7 +142,7 @@ class Message(object):
|
||||
import email.parser
|
||||
mime_headers = lib.dc_get_mime_headers(self._dc_context, self.id)
|
||||
if mime_headers:
|
||||
s = ffi.string(mime_headers)
|
||||
s = ffi.string(ffi.gc(mime_headers, lib.dc_str_unref))
|
||||
if isinstance(s, bytes):
|
||||
s = s.decode("ascii")
|
||||
return email.message_from_string(s)
|
||||
|
||||
Reference in New Issue
Block a user