mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-03 17:24:29 +00:00 
			
		
		
		
	ins_compl_add_tv: fix memory leaks via get_spec_reg (#8224)
Fixes #8186
This commit is contained in:
		
				
					committed by
					
						
						Justin M. Keyes
					
				
			
			
				
	
			
			
			
						parent
						
							60e96a45b4
						
					
				
				
					commit
					e40e300c16
				
			@@ -3615,6 +3615,9 @@ int ins_compl_add_tv(typval_T *const tv, const Direction dir)
 | 
			
		||||
    memset(cptext, 0, sizeof(cptext));
 | 
			
		||||
  }
 | 
			
		||||
  if (word == NULL || (!aempty && *word == NUL)) {
 | 
			
		||||
    for (size_t i = 0; i < CPT_COUNT; i++) {
 | 
			
		||||
      xfree(cptext[i]);
 | 
			
		||||
    }
 | 
			
		||||
    return FAIL;
 | 
			
		||||
  }
 | 
			
		||||
  return ins_compl_add((char_u *)word, -1, icase, NULL,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user