fixed #35 : memleak *pair in message_api.c in error case field == NULL
authorEdouard Tisserant
Mon, 11 Jul 2016 15:48:19 +0200
changeset 833e9ee49d7ab5a
parent 832 8a54e3a6b155
child 834 1108548edc67
child 838 70119c10b0f5
fixed #35 : memleak *pair in message_api.c in error case field == NULL
src/message_api.c
     1.1 --- a/src/message_api.c	Mon Jul 11 12:08:39 2016 +0200
     1.2 +++ b/src/message_api.c	Mon Jul 11 15:48:19 2016 +0200
     1.3 @@ -64,7 +64,10 @@
     1.4  
     1.5          stringpair_list_t *field = stringpair_list_add(msg->opt_fields, pair);
     1.6          if (field == NULL)
     1.7 +        {
     1.8 +            free_stringpair(pair);
     1.9              return;
    1.10 +        }
    1.11  
    1.12          if (msg->opt_fields == NULL)
    1.13              msg->opt_fields = field;