Avoid useless strdup() and free() calls
This commit is contained in:
		
							parent
							
								
									67274f91e9
								
							
						
					
					
						commit
						5fa23341b3
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1194,15 +1194,17 @@ servlist_load_defaults (void)
 | 
			
		|||
		if (def[i].network)
 | 
			
		||||
		{
 | 
			
		||||
			net = servlist_net_add (def[i].network, def[i].host, FALSE);
 | 
			
		||||
			net->encoding = strdup (IRC_DEFAULT_CHARSET);
 | 
			
		||||
			if (def[i].channel)
 | 
			
		||||
			{
 | 
			
		||||
				servlist_favchan_add (net, def[i].channel);
 | 
			
		||||
			}
 | 
			
		||||
			if (def[i].charset)
 | 
			
		||||
			{
 | 
			
		||||
				free (net->encoding);
 | 
			
		||||
				net->encoding = strdup (def[i].charset);
 | 
			
		||||
				net->encoding = g_strdup (def[i].charset);
 | 
			
		||||
			}
 | 
			
		||||
			else
 | 
			
		||||
			{
 | 
			
		||||
				net->encoding = g_strdup (IRC_DEFAULT_CHARSET);
 | 
			
		||||
			}
 | 
			
		||||
			if (def[i].loginmode)
 | 
			
		||||
			{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue