mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 15:41:43 +00:00 
			
		
		
		
	Prevent unlikely memory leak, tok should always be freed when parsetok() returns
This commit is contained in:
		
							parent
							
								
									19b0f40cb1
								
							
						
					
					
						commit
						56c6561d30
					
				
					 1 changed files with 1 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -108,6 +108,7 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
 | 
			
		|||
	if ((ps = PyParser_New(g, start)) == NULL) {
 | 
			
		||||
		fprintf(stderr, "no mem for new parser\n");
 | 
			
		||||
		err_ret->error = E_NOMEM;
 | 
			
		||||
		PyTokenizer_Free(tok);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
#if 0 /* future keyword */
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue