ENGINE=9: it helps to malloc the space for the data tructure, not just a pointer. DOH. ENGINE-9
authorKrista Bennett <krista@pep-project.org>
Fri, 30 Jun 2017 05:51:53 +0200
branchENGINE-9
changeset 19000aa3e9e7c850
parent 1898 7d6df20bf02c
child 1901 eabedbfc80e6
ENGINE=9: it helps to malloc the space for the data tructure, not just a pointer. DOH.
src/etpan_mime.c
     1.1 --- a/src/etpan_mime.c	Thu Jun 29 12:14:56 2017 +0200
     1.2 +++ b/src/etpan_mime.c	Fri Jun 30 05:51:53 2017 +0200
     1.3 @@ -642,9 +642,9 @@
     1.4          struct mailmime_field * _field = clist_content(cur);
     1.5          /* content_id */
     1.6          if (_field && _field->fld_type == MAILMIME_FIELD_ID) {
     1.7 -            pEp_rid_list_t* new_rid = (pEp_rid_list_t*)calloc(1, sizeof(pEp_rid_list_t*));
     1.8 +            pEp_rid_list_t* new_rid = (pEp_rid_list_t*)calloc(1, sizeof(pEp_rid_list_t));
     1.9              new_rid->rid_type = PEP_RID_CID;
    1.10 -            new_rid->rid = _field->fld_data.fld_id;
    1.11 +            new_rid->rid = strdup(_field->fld_data.fld_id);
    1.12              *rid_list_curr_p = new_rid;
    1.13              rid_list_curr_p = &new_rid->next;
    1.14          }
    1.15 @@ -660,9 +660,9 @@
    1.16                      struct mailmime_disposition_parm * param =
    1.17                              clist_content(cur2);
    1.18                      if (param->pa_type == MAILMIME_DISPOSITION_PARM_FILENAME) {
    1.19 -                        pEp_rid_list_t* new_rid = (pEp_rid_list_t*)calloc(1, sizeof(pEp_rid_list_t*));
    1.20 +                        pEp_rid_list_t* new_rid = (pEp_rid_list_t*)calloc(1, sizeof(pEp_rid_list_t));
    1.21                          new_rid->rid_type = PEP_RID_FILENAME;
    1.22 -                        new_rid->rid = param->pa_data.pa_filename;
    1.23 +                        new_rid->rid = strdup(param->pa_data.pa_filename);
    1.24                          *rid_list_curr_p = new_rid;
    1.25                          rid_list_curr_p = &new_rid->next;
    1.26                      }