unregister on failure keysync
authorVolker Birk <vb@pep.foundation>
Tue, 09 Aug 2016 00:28:53 +0200
branchkeysync
changeset 987923fdc4de690
parent 986 8f85f70bdd75
child 991 b230b6418b52
unregister on failure
src/sync.c
     1.1 --- a/src/sync.c	Tue Aug 09 00:08:08 2016 +0200
     1.2 +++ b/src/sync.c	Tue Aug 09 00:28:53 2016 +0200
     1.3 @@ -20,10 +20,8 @@
     1.4      // start state machine
     1.5      session->sync_state = InitState;
     1.6      PEP_STATUS status = fsm_DeviceState_inject(session, Init, NULL, NULL);
     1.7 -    if (status != PEP_STATUS_OK) {
     1.8 -        // stop state machine
     1.9 -        session->sync_state = DeviceState_state_NONE;
    1.10 -    }
    1.11 +    if (status != PEP_STATUS_OK)
    1.12 +        unregister_sync_callbacks(session);
    1.13  
    1.14      return status;
    1.15  }