free mem
authorHernâni Marques <hernani@pep.foundation>
Wed, 01 Nov 2017 05:25:04 +0100
changeset 222957c663920df4
parent 2228 823086369b6c
child 2230 29e0bfc4ca69
free mem
src/message_api.c
     1.1 --- a/src/message_api.c	Wed Nov 01 04:58:56 2017 +0100
     1.2 +++ b/src/message_api.c	Wed Nov 01 05:25:04 2017 +0100
     1.3 @@ -2188,6 +2188,7 @@
     1.4                      return PEP_OUT_OF_MEMORY;
     1.5                  memcpy(copy, _s->value, _s->size);
     1.6                  _m = bloblist_add(_m, copy, _s->size, _s->mime_type, _s->filename);
     1.7 +                free(copy);
     1.8                  if (_m == NULL)
     1.9                      return PEP_OUT_OF_MEMORY;
    1.10              }
    1.11 @@ -2199,6 +2200,7 @@
    1.12                  return PEP_OUT_OF_MEMORY;
    1.13              memcpy(copy, _s->value, _s->size);
    1.14              _m = bloblist_add(_m, copy, _s->size, _s->mime_type, _s->filename);
    1.15 +            free(copy);
    1.16              if (_m == NULL)
    1.17                  return PEP_OUT_OF_MEMORY;
    1.18          }