secp256k1_context_destroy: Allow NULL argument as a no-op
This commit is contained in:
		
							parent
							
								
									64b730bc3f
								
							
						
					
					
						commit
						9aac008038
					
				| @ -160,7 +160,7 @@ secp256k1_context_t* secp256k1_context_clone( | |||||||
|  */ |  */ | ||||||
| void secp256k1_context_destroy( | void secp256k1_context_destroy( | ||||||
|     secp256k1_context_t* ctx |     secp256k1_context_t* ctx | ||||||
| ) SECP256K1_ARG_NONNULL(1); | ); | ||||||
| 
 | 
 | ||||||
| /** Set a callback function to be called when an illegal argument is passed to
 | /** Set a callback function to be called when an illegal argument is passed to
 | ||||||
|  *  an API call. It will only trigger for violations that are mentioned |  *  an API call. It will only trigger for violations that are mentioned | ||||||
|  | |||||||
| @ -85,6 +85,9 @@ secp256k1_context_t* secp256k1_context_clone(const secp256k1_context_t* ctx) { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void secp256k1_context_destroy(secp256k1_context_t* ctx) { | void secp256k1_context_destroy(secp256k1_context_t* ctx) { | ||||||
|  |     if (!ctx) | ||||||
|  |         return; | ||||||
|  | 
 | ||||||
|     secp256k1_ecmult_context_clear(&ctx->ecmult_ctx); |     secp256k1_ecmult_context_clear(&ctx->ecmult_ctx); | ||||||
|     secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx); |     secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user