@@ -1966,6 +1966,7 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,
19661966 CLIENT_ERROR (context , "Failed to verify device signature (code %d)" , r );
19671967
19681968 pair_verify_context_free (context -> verify_context );
1969+ homekit_storage_pairing_free (pairing );
19691970 context -> verify_context = NULL ;
19701971
19711972 send_tlv_error_response (context , 4 , TLVError_Authentication );
@@ -1991,7 +1992,7 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,
19911992
19921993 pair_verify_context_free (context -> verify_context );
19931994 context -> verify_context = NULL ;
1994-
1995+ homekit_storage_pairing_free ( pairing );
19951996 send_tlv_error_response (context , 4 , TLVError_Unknown );
19961997 break ;
19971998 }
@@ -2012,7 +2013,7 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,
20122013 if (r ) {
20132014 CLIENT_ERROR (context , "Failed to derive write encryption key (code %d)" , r );
20142015
2015-
2016+ homekit_storage_pairing_free ( pairing );
20162017 send_tlv_error_response (context , 4 , TLVError_Unknown );
20172018 break ;
20182019 }
@@ -2025,7 +2026,7 @@ void homekit_server_on_pair_verify(client_context_t *context, const byte *data,
20252026 context -> pairing_id = pairing_id ;
20262027 context -> permissions = permissions ;
20272028 context -> encrypted = true;
2028-
2029+ homekit_storage_pairing_free ( pairing );
20292030 HOMEKIT_NOTIFY_EVENT (context -> server , HOMEKIT_EVENT_CLIENT_VERIFIED );
20302031
20312032 CLIENT_INFO (context , "Verification successful, secure session established" );
0 commit comments