src/message_api.c
branch2028_fix
changeset 2035 61b05d325adc
parent 2034 b6742bbca2d2
child 2043 fd40bf23930d
child 2045 162803eb47e0
     1.1 --- a/src/message_api.c	Tue Sep 05 18:46:05 2017 +0200
     1.2 +++ b/src/message_api.c	Wed Sep 06 01:48:08 2017 +0200
     1.3 @@ -211,32 +211,6 @@
     1.4      return -1;
     1.5  }
     1.6  
     1.7 -// static void remove_msg_version_field(message* msg) {
     1.8 -//     assert(msg);
     1.9 -// 
    1.10 -//     stringpair_list_t* msg_opt_flds_curr = msg->opt_fields;
    1.11 -//     stringpair_list_t** msg_opt_flds_prev_p = NULL;
    1.12 -//     
    1.13 -//     while (msg_opt_flds_curr) {
    1.14 -//         char* fld_key = msg_opt_flds_curr->value->key;
    1.15 -//         if (fld_key) {
    1.16 -//             if (strcmp(fld_key, "X-pEp-Message-Version") == 0) {
    1.17 -//                 if (!msg_opt_flds_prev_p) {
    1.18 -//                     msg->opt_fields = msg_opt_flds_curr->next;
    1.19 -//                 }
    1.20 -//                 else {
    1.21 -//                     (*msg_opt_flds_prev_p)->next = msg_opt_flds_curr->next;
    1.22 -//                 }
    1.23 -//                 msg_opt_flds_curr->next = NULL;
    1.24 -//                 free_stringpair_list(msg_opt_flds_curr);
    1.25 -//                 break;
    1.26 -//             }
    1.27 -//             *msg_opt_flds_prev_p = msg_opt_flds_curr;
    1.28 -//             msg_opt_flds_curr = msg_opt_flds_curr->next;
    1.29 -//         }
    1.30 -//     }
    1.31 -// }
    1.32 -
    1.33  static PEP_STATUS copy_fields(message *dst, const message *src)
    1.34  {
    1.35      assert(dst);
    1.36 @@ -353,102 +327,6 @@
    1.37      return PEP_STATUS_OK;
    1.38  }
    1.39  
    1.40 -
    1.41 -static message* extract_minimal_envelope(const message* src, 
    1.42 -                                         PEP_msg_direction direct) {
    1.43 -    
    1.44 -    message* envelope = new_message(direct);
    1.45 -    if (!envelope)
    1.46 -        return NULL;
    1.47 -        
    1.48 -    envelope->shortmsg = strdup("pEp");
    1.49 -    if (!envelope->shortmsg)
    1.50 -        return NULL;
    1.51 -
    1.52 -    if (src->from) {
    1.53 -        envelope->from = identity_dup(src->from);
    1.54 -        if (!envelope->from)
    1.55 -            return NULL;
    1.56 -    }
    1.57 -
    1.58 -    if (src->to) {
    1.59 -        envelope->to = identity_list_dup(src->to);
    1.60 -        if (!envelope->to)
    1.61 -            return NULL;
    1.62 -    }
    1.63 -
    1.64 -    if (src->cc) {
    1.65 -        envelope->cc = identity_list_dup(src->cc);
    1.66 -        if (!envelope->cc)
    1.67 -            return NULL;
    1.68 -    }
    1.69 -
    1.70 -    if (src->bcc) {
    1.71 -        envelope->bcc = identity_list_dup(src->bcc);
    1.72 -        if (!envelope->bcc)
    1.73 -            return NULL;
    1.74 -    }
    1.75 -
    1.76 -    /* DO WE WANT TO EXPOSE THIS??? */
    1.77 -    if (src->reply_to) {
    1.78 -        envelope->reply_to = identity_list_dup(src->reply_to);
    1.79 -        if (!envelope->reply_to)
    1.80 -            return NULL;
    1.81 -    }
    1.82 -
    1.83 -    envelope->enc_format = src->enc_format;        
    1.84 -    
    1.85 -    return envelope;
    1.86 -}
    1.87 -
    1.88 -static void add_message_version(
    1.89 -    message* msg,
    1.90 -    int major_version,
    1.91 -    int minor_version
    1.92 -)
    1.93 -{
    1.94 -    assert(msg);
    1.95 -    
    1.96 -    char buf[8]; // xxx.xxx\0
    1.97 -    if (major_version < 1000 && minor_version < 1000) {
    1.98 -        int chars_set = sprintf(buf, "%d.%d", major_version, minor_version);
    1.99 -        if (chars_set >= 3)
   1.100 -            add_opt_field(msg, "X-pEp-Message-Version", buf);
   1.101 -    }
   1.102 -}
   1.103 -
   1.104 -static message* wrap_message_as_attachment(message* envelope, 
   1.105 -    const message* attachment) {
   1.106 -    
   1.107 -    message* _envelope = NULL;
   1.108 -    
   1.109 -    if (!envelope) {
   1.110 -        _envelope = extract_minimal_envelope(attachment, PEP_dir_outgoing);
   1.111 -        if (!_envelope)
   1.112 -            return PEP_UNKNOWN_ERROR;
   1.113 -        envelope = _envelope;
   1.114 -    }
   1.115 -    
   1.116 -    char* message_text = NULL;
   1.117 -    /* Turn message into a MIME-blob */
   1.118 -    PEP_STATUS status = mime_encode_message(attachment, false, &message_text);
   1.119 -    
   1.120 -    if (status != PEP_STATUS_OK || !message_text) {
   1.121 -        free(_envelope);
   1.122 -        return NULL;
   1.123 -    }
   1.124 -    
   1.125 -    size_t message_len = strlen(message_text);
   1.126 -    
   1.127 -    bloblist_t* message_blob = new_bloblist(message_text, message_len,
   1.128 -                                            "message/rfc822", NULL);
   1.129 -    
   1.130 -    envelope->attachments = message_blob;
   1.131 -    add_message_version(envelope, 2, 0);
   1.132 -    
   1.133 -    return envelope;
   1.134 -}
   1.135 -
   1.136  static message * clone_to_empty_message(const message * src)
   1.137  {
   1.138      PEP_STATUS status;
   1.139 @@ -580,8 +458,6 @@
   1.140      return status;
   1.141  }
   1.142  
   1.143 -// N.B. TO BE MOVED TO READ-ONLY
   1.144 -// FIXME: Does this happen concurrent w/ message 2.0 merge?
   1.145  static PEP_STATUS encrypt_PGP_in_pieces(
   1.146      PEP_SESSION session,
   1.147      const message *src,
   1.148 @@ -1244,8 +1120,6 @@
   1.149      PEP_STATUS status = PEP_STATUS_OK;
   1.150      message * msg = NULL;
   1.151      stringlist_t * keys = NULL;
   1.152 -    message* _src = NULL;
   1.153 -    bool no_wrap_message = (flags & PEP_encrypt_flag_dont_raise_headers);
   1.154  
   1.155      assert(session);
   1.156      assert(src);
   1.157 @@ -1373,37 +1247,21 @@
   1.158          return ADD_TO_LOG(PEP_UNENCRYPTED);
   1.159      }
   1.160      else {
   1.161 -        if (no_wrap_message) {
   1.162 -            msg = clone_to_empty_message(src);
   1.163 -            _src = src;
   1.164 -        }
   1.165 -        else {
   1.166 -            // encrypt inner message
   1.167 -            message* inner_message = NULL;
   1.168 -            status = encrypt_message(session, src, extra, &inner_message,
   1.169 -                                     enc_format, flags | PEP_encrypt_flag_dont_raise_headers);                         
   1.170 -            _src = wrap_message_as_attachment(NULL, inner_message);
   1.171 -            if (_src == NULL) {
   1.172 -                status = PEP_UNKNOWN_ERROR;
   1.173 -                goto pep_error;
   1.174 -            }
   1.175 -            msg = clone_to_empty_message(_src);
   1.176 -        }
   1.177 +        msg = clone_to_empty_message(src);
   1.178          if (msg == NULL)
   1.179              goto enomem;
   1.180  
   1.181          if (!(flags & PEP_encrypt_flag_force_no_attached_key))
   1.182 -            attach_own_key(session, _src);
   1.183 +            attach_own_key(session, src);
   1.184  
   1.185          switch (enc_format) {
   1.186          case PEP_enc_PGP_MIME:
   1.187          case PEP_enc_PEP: // BUG: should be implemented extra
   1.188 -            status = encrypt_PGP_MIME(session, _src, keys, msg, flags);
   1.189 +            status = encrypt_PGP_MIME(session, src, keys, msg, flags);
   1.190              break;
   1.191  
   1.192 -        // This actually doesn't really make sense for message 2.0... See function comment below
   1.193          case PEP_enc_pieces:
   1.194 -            status = encrypt_PGP_in_pieces(session, _src, keys, msg, flags);
   1.195 +            status = encrypt_PGP_in_pieces(session, src, keys, msg, flags);
   1.196              break;
   1.197  
   1.198          /* case PEP_enc_PEP:
   1.199 @@ -1434,8 +1292,8 @@
   1.200  
   1.201      if (msg) {
   1.202          decorate_message(msg, PEP_rating_undefined, NULL);
   1.203 -        if (_src->id) {
   1.204 -            msg->id = strdup(_src->id);
   1.205 +        if (src->id) {
   1.206 +            msg->id = strdup(src->id);
   1.207              assert(msg->id);
   1.208              if (msg->id == NULL)
   1.209                  goto enomem;
   1.210 @@ -1443,7 +1301,6 @@
   1.211      }
   1.212  
   1.213      *dst = msg;
   1.214 -//    free_message(wrapped_msg);
   1.215      return ADD_TO_LOG(status);
   1.216  
   1.217  enomem:
   1.218 @@ -1452,8 +1309,7 @@
   1.219  pep_error:
   1.220      free_stringlist(keys);
   1.221      free_message(msg);
   1.222 -    if (!no_wrap_message)
   1.223 -        free_message(_src);
   1.224 +
   1.225      return ADD_TO_LOG(status);
   1.226  }
   1.227  
   1.228 @@ -1515,11 +1371,7 @@
   1.229      switch (enc_format) {
   1.230          case PEP_enc_PGP_MIME:
   1.231          case PEP_enc_PEP: // BUG: should be implemented extra
   1.232 -            // N.B. Don't raise headers, as we want to send a 1.0 message back.
   1.233 -            // If this is a draft, obviously that will change when it's reencrypted
   1.234 -            // for everybody else.
   1.235 -            status = encrypt_PGP_MIME(session, src, keys, msg, 
   1.236 -                                      flags | PEP_encrypt_flag_dont_raise_headers);
   1.237 +            status = encrypt_PGP_MIME(session, src, keys, msg, flags);
   1.238              break;
   1.239  
   1.240          case PEP_enc_pieces:
   1.241 @@ -1580,60 +1432,8 @@
   1.242      return false;
   1.243  }
   1.244  
   1.245 -static const char* pEpmessage_version_str(const message *msg)
   1.246 -{
   1.247 -    char* retval = NULL;
   1.248 -    for (stringpair_list_t *i = msg->opt_fields; i && i->value ; i=i->next) {
   1.249 -        if (strcasecmp(i->value->key, "X-pEp-Message-Version") == 0) {
   1.250 -            retval = i->value->value;
   1.251 -            break;
   1.252 -        }
   1.253 -    }
   1.254 -    return retval;
   1.255 -}
   1.256 -
   1.257 -static int pEpmessage_major_version(const message *msg) {
   1.258 -    const char* version_string = pEpmessage_version_str(msg);
   1.259 -    if (!version_string)
   1.260 -        return -1;
   1.261 -    
   1.262 -    int ver_strlen = strlen(version_string);
   1.263 -    if (ver_strlen < 3)
   1.264 -        return -1;
   1.265 -        
   1.266 -    const short MAX_MAJ_VERSION_DIGITS = 4; // I certainly hope...    
   1.267 -    char version_buf[MAX_MAJ_VERSION_DIGITS + 1];
   1.268 -
   1.269 -    int i = 0;    
   1.270 -    
   1.271 -    for ( ; i < MAX_MAJ_VERSION_DIGITS && i < ver_strlen; i++ ) {
   1.272 -        if (version_string[i] == '.') {
   1.273 -            version_buf[i] = '\0';
   1.274 -            break;
   1.275 -        }
   1.276 -        version_buf[i] = version_string[i];
   1.277 -    }
   1.278 -    
   1.279 -    if (version_string[i] != '.')
   1.280 -        return -1;
   1.281 -    
   1.282 -    // ok, this is some chars + \0, but not necessarily numeric.
   1.283 -    int retval = atoi(version_buf);
   1.284 -    if (retval == 0 && version_buf[0] != 0)
   1.285 -        return -1;
   1.286 -    
   1.287 -    return retval;
   1.288 -}
   1.289 -
   1.290 -// static bool verify_explicit_message_version(const char* desired_version, 
   1.291 -//     const message* msg) {
   1.292 -//     if (!desired_version || !msg)
   1.293 -//         return false;
   1.294 -//     const char* msg_version_str = pEpmessage_version_str(msg);
   1.295 -//     return (msg_version_str && (strcmp(desired_version, msg_version_str) == 0));
   1.296 -// }
   1.297 -
   1.298  // update comm_type to pEp_ct_pEp if needed
   1.299 +
   1.300  static PEP_STATUS _update_identity_for_incoming_message(
   1.301          PEP_SESSION session,
   1.302          const message *src
   1.303 @@ -1861,29 +1661,6 @@
   1.304      return status;
   1.305  }
   1.306  
   1.307 -static void pull_up_longmsg_attachment(message* msg) {
   1.308 -    bloblist_t* matt = msg->attachments;
   1.309 -    if (matt) {
   1.310 -        const char* inner_mime_type = matt->mime_type;
   1.311 -        if (strcasecmp(inner_mime_type, "text/plain") == 0) {
   1.312 -            free(msg->longmsg); /* in case of "" */
   1.313 -            msg->longmsg = strndup(matt->value, matt->size);
   1.314 -            
   1.315 -            bloblist_t* next_node = matt->next;
   1.316 -            if (next_node) {
   1.317 -                inner_mime_type = next_node->mime_type;
   1.318 -                if (strcasecmp(inner_mime_type, "text/html") == 0) {
   1.319 -                    free(msg->longmsg_formatted);
   1.320 -                    msg->longmsg_formatted = strndup(next_node->value, next_node->size);
   1.321 -                }
   1.322 -            }
   1.323 -        }
   1.324 -        else if (strcasecmp(inner_mime_type, "text/html") == 0) {
   1.325 -            free(msg->longmsg_formatted);
   1.326 -            msg->longmsg_formatted = strndup(matt->value, matt->size);
   1.327 -        }
   1.328 -    }
   1.329 -}
   1.330  
   1.331  DYNAMIC_API PEP_STATUS _decrypt_message(
   1.332          PEP_SESSION session,
   1.333 @@ -1903,7 +1680,6 @@
   1.334      char *ptext = NULL;
   1.335      size_t psize;
   1.336      stringlist_t *_keylist = NULL;
   1.337 -    message *inner_message = NULL; // For version 2.0+ messages
   1.338  
   1.339      assert(session);
   1.340      assert(src);
   1.341 @@ -1964,9 +1740,31 @@
   1.342              
   1.343              char* slong = src->longmsg;
   1.344              char* sform = src->longmsg_formatted;
   1.345 +            bloblist_t* satt = src->attachments;
   1.346              
   1.347 -            if ((!slong || slong[0] == '\0') && (!sform || sform[0] == '\0'))                
   1.348 -                pull_up_longmsg_attachment(src);
   1.349 +            if ((!slong || slong[0] == '\0')
   1.350 +                 && (!sform || sform[0] == '\0')) {
   1.351 +                if (satt) {
   1.352 +                    const char* inner_mime_type = satt->mime_type;
   1.353 +                    if (strcasecmp(inner_mime_type, "text/plain") == 0) {
   1.354 +                        free(slong); /* in case of "" */
   1.355 +                        src->longmsg = strndup(satt->value, satt->size); // N.B.: longmsg might be shorter, if attachment contains NUL bytes which are not allowed in text/plain!
   1.356 +                        
   1.357 +                        bloblist_t* next_node = satt->next;
   1.358 +                        if (next_node) {
   1.359 +                            inner_mime_type = next_node->mime_type;
   1.360 +                            if (strcasecmp(inner_mime_type, "text/html") == 0) {
   1.361 +                                free(sform);
   1.362 +                                src->longmsg_formatted = strndup(next_node->value, next_node->size);  // N.B.: longmsg might be shorter, if attachment contains NUL bytes which are not allowed in text/plain!
   1.363 +                            }
   1.364 +                        }
   1.365 +                    }
   1.366 +                    else if (strcasecmp(inner_mime_type, "text/html") == 0) {
   1.367 +                        free(sform);
   1.368 +                        src->longmsg_formatted = strndup(satt->value, satt->size);  // N.B.: longmsg might be shorter, if attachment contains NUL bytes which are not allowed in text/plain!
   1.369 +                    }
   1.370 +                }
   1.371 +            }
   1.372              
   1.373              return ADD_TO_LOG(PEP_UNENCRYPTED);
   1.374  
   1.375 @@ -2015,44 +1813,32 @@
   1.376                  if (status != PEP_STATUS_OK)
   1.377                      goto pep_error;
   1.378                  
   1.379 -                int msg_major_version = pEpmessage_major_version(src);
   1.380 -                
   1.381 -                if (msg_major_version > 1) {
   1.382 -                    status = mime_decode_message(msg->attachments->value, 
   1.383 -                                                 msg->attachments->size,
   1.384 -                                                 &inner_message);
   1.385 -                    if (status != PEP_STATUS_OK)
   1.386 -                        goto pep_error;
   1.387 -                    
   1.388 -                    int inner_message_version = pEpmessage_major_version(inner_message);
   1.389 -                    
   1.390 -                    /* recurse one level if need be */
   1.391 -                    if (inner_message_version < 2) {
   1.392 -                        status = _decrypt_message(session, inner_message,
   1.393 -                                                  dst, keylist, rating, 
   1.394 -                                                  flags, private_il);
   1.395 -                        
   1.396 -                        free_message(inner_message);
   1.397 -                        return status;
   1.398 -                    }
   1.399 -                    /* 
   1.400 -                       otherwise, we're just going to verify the outer
   1.401 -                       message's keylist etc, and then pull up at the end.
   1.402 -                    */
   1.403 -                }
   1.404 -                                    
   1.405                  char* mlong = msg->longmsg;
   1.406                  char* mform = msg->longmsg_formatted;
   1.407 +                bloblist_t* matt = msg->attachments;
   1.408                  
   1.409 -                /* Note: we don't do this for Version 2.0+ inner messages, as we want to
   1.410 -                   return the whole message, not just the attachment, in that case.
   1.411 -                   (N.B. Version 2.0+ inner messages are themselves compound messages,
   1.412 -                   and the inner message is probably one that needs to be routed
   1.413 -                   elsewhere by the transport) 
   1.414 -                */
   1.415 -                if (!inner_message && (!mlong || mlong[0] == '\0') && (!mform || mform[0] == '\0')) {             
   1.416 -                    pull_up_longmsg_attachment(msg);
   1.417 -                    
   1.418 +                if ((!mlong || mlong[0] == '\0')
   1.419 +                     && (!mform || mform[0] == '\0')) {
   1.420 +                    if (matt) {
   1.421 +                        const char* inner_mime_type = matt->mime_type;
   1.422 +                        if (strcasecmp(inner_mime_type, "text/plain") == 0) {
   1.423 +                            free(mlong); /* in case of "" */
   1.424 +                            msg->longmsg = strndup(matt->value, matt->size);
   1.425 +                            
   1.426 +                            bloblist_t* next_node = matt->next;
   1.427 +                            if (next_node) {
   1.428 +                                inner_mime_type = next_node->mime_type;
   1.429 +                                if (strcasecmp(inner_mime_type, "text/html") == 0) {
   1.430 +                                    free(mform);
   1.431 +                                    msg->longmsg_formatted = strndup(next_node->value, next_node->size);
   1.432 +                                }
   1.433 +                            }
   1.434 +                        }
   1.435 +                        else if (strcasecmp(inner_mime_type, "text/html") == 0) {
   1.436 +                            free(mform);
   1.437 +                            msg->longmsg_formatted = strndup(matt->value, matt->size);
   1.438 +                        }
   1.439 +                    }
   1.440                      if (msg->shortmsg) {
   1.441                          free(src->shortmsg);
   1.442                          src->shortmsg = strdup(msg->shortmsg);
   1.443 @@ -2183,45 +1969,43 @@
   1.444                  {
   1.445                      GOTO(pep_error);
   1.446                  }
   1.447 -                
   1.448 -                if (!inner_message) {
   1.449 -                    if (src->shortmsg == NULL || strcmp(src->shortmsg, "pEp") == 0)
   1.450 -                    {
   1.451 -                        char * shortmsg;
   1.452 -                        char * longmsg;
   1.453 -
   1.454 -                        int r = separate_short_and_long(msg->longmsg, &shortmsg,
   1.455 -                                &longmsg);
   1.456 -                        
   1.457 -                        if (r == -1)
   1.458 -                            goto enomem;
   1.459 -
   1.460 -                        if (shortmsg == NULL) {
   1.461 -                            if (src->shortmsg == NULL)
   1.462 -                                shortmsg = strdup("");
   1.463 -                            else {
   1.464 -                                // FIXME: is msg->shortmsg always a copy of
   1.465 -                                // src->shortmsg already?
   1.466 -                                // if so, we need to change the logic so
   1.467 -                                // that in this case, we don't free msg->shortmsg
   1.468 -                                // and do this strdup, etc.
   1.469 -                                shortmsg = strdup(src->shortmsg);
   1.470 -                            }
   1.471 +
   1.472 +                if (src->shortmsg == NULL || strcmp(src->shortmsg, "pEp") == 0)
   1.473 +                {
   1.474 +                    char * shortmsg;
   1.475 +                    char * longmsg;
   1.476 +
   1.477 +                    int r = separate_short_and_long(msg->longmsg, &shortmsg,
   1.478 +                            &longmsg);
   1.479 +                    
   1.480 +                    if (r == -1)
   1.481 +                        goto enomem;
   1.482 +
   1.483 +                    if (shortmsg == NULL) {
   1.484 +                        if (src->shortmsg == NULL)
   1.485 +                            shortmsg = strdup("");
   1.486 +                        else {
   1.487 +                            // FIXME: is msg->shortmsg always a copy of
   1.488 +                            // src->shortmsg already?
   1.489 +                            // if so, we need to change the logic so
   1.490 +                            // that in this case, we don't free msg->shortmsg
   1.491 +                            // and do this strdup, etc.
   1.492 +                            shortmsg = strdup(src->shortmsg);
   1.493                          }
   1.494 -
   1.495 -
   1.496 -                        free(msg->shortmsg);
   1.497 -                        free(msg->longmsg);
   1.498 -
   1.499 -                        msg->shortmsg = shortmsg;
   1.500 -                        msg->longmsg = longmsg;
   1.501                      }
   1.502 -                    else {
   1.503 -                        msg->shortmsg = strdup(src->shortmsg);
   1.504 -                        assert(msg->shortmsg);
   1.505 -                        if (msg->shortmsg == NULL)
   1.506 -                            goto enomem;
   1.507 -                    }
   1.508 +
   1.509 +
   1.510 +                    free(msg->shortmsg);
   1.511 +                    free(msg->longmsg);
   1.512 +
   1.513 +                    msg->shortmsg = shortmsg;
   1.514 +                    msg->longmsg = longmsg;
   1.515 +                }
   1.516 +                else {
   1.517 +                    msg->shortmsg = strdup(src->shortmsg);
   1.518 +                    assert(msg->shortmsg);
   1.519 +                    if (msg->shortmsg == NULL)
   1.520 +                        goto enomem;
   1.521                  }
   1.522                  break;
   1.523              default:
   1.524 @@ -2309,10 +2093,6 @@
   1.525          *flags |= PEP_decrypt_flag_own_private_key;
   1.526      }
   1.527  
   1.528 -    // FIXME: To here, we're ok with the separate messages. We need to
   1.529 -    //        specify what clients expect when this is a 2.0 message.
   1.530 -    //        IMHO, we don't need the keylist at that point, just 
   1.531 -    //        the rating and move on.
   1.532      if (msg) {
   1.533          decorate_message(msg, *rating, _keylist);
   1.534          if (imported_keys)
   1.535 @@ -2343,12 +2123,7 @@
   1.536          }
   1.537      }
   1.538  
   1.539 -    if (inner_message)
   1.540 -        *dst = inner_message;
   1.541 -    else
   1.542 -        *dst = msg;
   1.543 -        
   1.544 -    // I think we keep it this way for 2.0 inner messages.
   1.545 +    *dst = msg;
   1.546      *keylist = _keylist;
   1.547  
   1.548      if(decrypt_status == PEP_DECRYPTED_AND_VERIFIED)
   1.549 @@ -2361,8 +2136,6 @@
   1.550  
   1.551  pep_error:
   1.552      free(ptext);
   1.553 -    if (inner_message) // necessary? FIXME: check
   1.554 -        free_message(inner_message);
   1.555      free_message(msg);
   1.556      free_stringlist(_keylist);
   1.557