From b5633df1b51c8a1251bae7af87b8472d3fb65ef8 Mon Sep 17 00:00:00 2001 From: Holger Berndt Date: Sun, 7 Apr 2013 16:29:40 +0200 Subject: [PATCH] Python plugin: const fix It seems a bit strange for procheader_get_header_from_msginfo() to require a non-const header string argument, though. --- src/plugins/python/messageinfotype.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/python/messageinfotype.c b/src/plugins/python/messageinfotype.c index a46c6315d..766b29a1d 100644 --- a/src/plugins/python/messageinfotype.c +++ b/src/plugins/python/messageinfotype.c @@ -216,6 +216,7 @@ static PyObject* get_header(PyObject *self, PyObject *args) { int retval; const char *header_str; + char *header_str_dup; MsgInfo *msginfo; gchar header_content[HEADER_CONTENT_SIZE]; @@ -225,7 +226,10 @@ static PyObject* get_header(PyObject *self, PyObject *args) msginfo = ((clawsmail_MessageInfoObject*)self)->msginfo; - if(procheader_get_header_from_msginfo(msginfo, header_content, HEADER_CONTENT_SIZE, header_str) == 0) { + header_str_dup = g_strdup(header_str); + retval = procheader_get_header_from_msginfo(msginfo, header_content, HEADER_CONTENT_SIZE, header_str); + g_free(header_str_dup); + if(retval == 0) { PyObject *header_content_object; gchar *content_start; -- 2.25.1