diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-01-22 14:49:35 +0100 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-01-22 14:49:35 +0100 |
commit | e22c9d7e579210f39008923937e15b45fb226319 (patch) | |
tree | b00b0bde59381b4711497f1e57519f4f363d98a0 /src/identity-provider | |
parent | 8a9db739bafc7ab8fc533a19072649161daa5ef0 (diff) |
fix memleak
Diffstat (limited to 'src/identity-provider')
-rw-r--r-- | src/identity-provider/identity_provider_api.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/identity-provider/identity_provider_api.c b/src/identity-provider/identity_provider_api.c index 38c11841c0..e993a1ac78 100644 --- a/src/identity-provider/identity_provider_api.c +++ b/src/identity-provider/identity_provider_api.c @@ -376,6 +376,15 @@ free_it (struct GNUNET_IDENTITY_PROVIDER_AttributeIterator *it) GNUNET_free (it); } +static void +free_op (struct GNUNET_IDENTITY_PROVIDER_Operation* op) +{ + if (NULL == op) + return; + if (NULL != op->env) + GNUNET_MQ_discard (op->env); + GNUNET_free(op); +} /** @@ -434,7 +443,7 @@ handle_attribute_store_response (void *cls, GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); - GNUNET_free (op); + free_op (op); } @@ -522,7 +531,7 @@ handle_consume_ticket_result (void *cls, GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); - GNUNET_free (op); + free_op (op); } return; } @@ -613,7 +622,7 @@ handle_attribute_result (void *cls, GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); - GNUNET_free (op); + free_op (op); } return; @@ -709,7 +718,7 @@ handle_ticket_result (void *cls, if (NULL != op->tr_cb) op->tr_cb (op->cls, ticket); } - GNUNET_free (op); + free_op (op); return; } else if (NULL != it) { if (msg_len == sizeof (struct TicketResultMessage)) @@ -730,6 +739,7 @@ handle_ticket_result (void *cls, GNUNET_break (0); } + /** * Handle an incoming message of type * #GNUNET_MESSAGE_TYPE_IDENTITY_PROVIDER_REVOKE_TICKET_RESULT @@ -766,7 +776,7 @@ handle_revoke_ticket_result (void *cls, GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); - GNUNET_free (op); + free_op (op); return; } GNUNET_assert (0); @@ -864,7 +874,7 @@ GNUNET_IDENTITY_PROVIDER_cancel (struct GNUNET_IDENTITY_PROVIDER_Operation *op) h->op_tail, op); GNUNET_MQ_discard (op->env); - GNUNET_free (op); + free_op (op); } |