File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed 
src/native/libs/System.Security.Cryptography.Native Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -369,32 +369,35 @@ int32_t CryptoNative_EvpMacOneShot(EVP_MAC* mac,
369369
370370        params [i ] =  OSSL_PARAM_construct_end ();
371371
372+         int32_t  ret  =  0 ;
373+ 
372374        if  (!EVP_MAC_init (ctx , NULL , 0 , params ))
373375        {
374-             EVP_MAC_CTX_free (ctx );
375-             return  0 ;
376+             goto done ;
376377        }
377378
378379        if  (!EVP_MAC_update (ctx , data , dataLengthT ))
379380        {
380-             EVP_MAC_CTX_free (ctx );
381-             return  0 ;
381+             goto done ;
382382        }
383383
384384        size_t  written  =  0 ;
385385
386386        if  (!EVP_MAC_final (ctx , destination , & written , macLengthT ))
387387        {
388-             EVP_MAC_CTX_free (ctx );
389-             return  0 ;
388+             goto done ;
390389        }
391390
392391        if  (written  !=  macLengthT )
393392        {
394-             return  -3 ;
393+             ret  =  -3 ;
394+             goto done ;
395395        }
396396
397-         return  1 ;
397+         ret  =  1 ;
398+ done :
399+         EVP_MAC_CTX_free (ctx );
400+         return  ret ;
398401    }
399402#else 
400403    (void )mac ;
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments