error checking
authorKrista Bennett <krista@pep-project.org>
Thu, 31 Aug 2017 11:59:41 +0200
changeset 20274eda8aa79e5b
parent 2026 abfaf7856b83
child 2028 fa5a0fb170ba
error checking
src/mime.c
     1.1 --- a/src/mime.c	Thu Aug 31 11:54:22 2017 +0200
     1.2 +++ b/src/mime.c	Thu Aug 31 11:59:41 2017 +0200
     1.3 @@ -707,12 +707,18 @@
     1.4          bloblist_t* inlined_attachments = NULL;
     1.5          /* Noooooo... dirk, why do you do this to me? */
     1.6          message* duped_msg = message_dup(msg);
     1.7 +        
     1.8 +        if (!duped_msg) {
     1.9 +            status = PEP_OUT_OF_MEMORY;
    1.10 +            goto pep_error;
    1.11 +        }
    1.12 +        
    1.13          split_inlined_and_attached(&inlined_attachments, &duped_msg->attachments);
    1.14  
    1.15 +        free_message(duped_msg);
    1.16 +
    1.17          status = mime_html_text(plaintext, htmltext, inlined_attachments, &mime);
    1.18 -        
    1.19 -        free_message(duped_msg);
    1.20 -        
    1.21 +                
    1.22          if (status != PEP_STATUS_OK)
    1.23              goto pep_error;
    1.24      }