new_ and free_ together keysync
authorVolker Birk <vb@pep.foundation>
Tue, 23 Aug 2016 15:01:06 +0200
branchkeysync
changeset 1066e6db6bb9d542
parent 1065 090aa9b11a99
child 1067 58e31ac5520c
new_ and free_ together
src/sync_impl.c
src/sync_send_actions.c
sync/gen_actions_skeleton.ysl2
     1.1 --- a/src/sync_impl.c	Tue Aug 23 14:58:47 2016 +0200
     1.2 +++ b/src/sync_impl.c	Tue Aug 23 15:01:06 2016 +0200
     1.3 @@ -183,14 +183,12 @@
     1.4  
     1.5      status = session->messageToSend(session->sync_obj, _message);
     1.6  
     1.7 -    free_DeviceGroup_Protocol_msg(msg);
     1.8      free_identity(partner);
     1.9      return status;
    1.10  
    1.11  enomem:
    1.12      status = PEP_OUT_OF_MEMORY;
    1.13  error:
    1.14 -    free_DeviceGroup_Protocol_msg(msg);
    1.15      free(payload);
    1.16      free_message(_message);
    1.17      free_identity(me);
    1.18 @@ -234,12 +232,10 @@
    1.19      }
    1.20  
    1.21      free_identity_list(own_identities);
    1.22 -    free_DeviceGroup_Protocol_msg(msg);
    1.23      return PEP_STATUS_OK;
    1.24  
    1.25  enomem:
    1.26      free_identity_list(own_identities);
    1.27 -    free_DeviceGroup_Protocol_msg(msg);
    1.28      return PEP_OUT_OF_MEMORY;
    1.29  }
    1.30  
     2.1 --- a/src/sync_send_actions.c	Tue Aug 23 14:58:47 2016 +0200
     2.2 +++ b/src/sync_send_actions.c	Tue Aug 23 15:01:06 2016 +0200
     2.3 @@ -45,6 +45,7 @@
     2.4      if (status != PEP_STATUS_OK)
     2.5          goto error;
     2.6  
     2.7 +    free_DeviceGroup_Protocol_msg(msg);
     2.8      return PEP_STATUS_OK;
     2.9  
    2.10  enomem:
    2.11 @@ -86,6 +87,7 @@
    2.12      if (status != PEP_STATUS_OK)
    2.13          goto error;
    2.14  
    2.15 +    free_DeviceGroup_Protocol_msg(msg);
    2.16      return PEP_STATUS_OK;
    2.17  
    2.18  enomem:
    2.19 @@ -135,6 +137,7 @@
    2.20          goto error;
    2.21  
    2.22      free_identity_list(kl);
    2.23 +    free_DeviceGroup_Protocol_msg(msg);
    2.24      return PEP_STATUS_OK;
    2.25  
    2.26  enomem:
     3.1 --- a/sync/gen_actions_skeleton.ysl2	Tue Aug 23 14:58:47 2016 +0200
     3.2 +++ b/sync/gen_actions_skeleton.ysl2	Tue Aug 23 15:01:06 2016 +0200
     3.3 @@ -192,6 +192,7 @@
     3.4                  goto error;
     3.5  
     3.6              `` if "$name='GroupKeys'" |> free_identity_list(kl);
     3.7 +            free_DeviceGroup_Protocol_msg(msg);
     3.8              return PEP_STATUS_OK;
     3.9  
    3.10          enomem: