mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pipewire: allow NULL pointers in pw_memmap_free()
Just like the real free() we should just ignore a NULL pointer, makes the caller code easier for those instances where properties are optional.
This commit is contained in:
		
							parent
							
								
									71e0cfb5fa
								
							
						
					
					
						commit
						1d4b24d02b
					
				
					 4 changed files with 18 additions and 16 deletions
				
			
		| 
						 | 
				
			
			@ -1472,8 +1472,7 @@ static int client_node_set_io(void *object,
 | 
			
		|||
	default:
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
	if (old != NULL)
 | 
			
		||||
		pw_memmap_free(old);
 | 
			
		||||
	pw_memmap_free(old);
 | 
			
		||||
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -2085,8 +2084,7 @@ static int client_node_port_set_io(void *object,
 | 
			
		|||
		break;
 | 
			
		||||
	}
 | 
			
		||||
exit_free:
 | 
			
		||||
	if (old != NULL)
 | 
			
		||||
		pw_memmap_free(old);
 | 
			
		||||
	pw_memmap_free(old);
 | 
			
		||||
exit:
 | 
			
		||||
	if (res < 0)
 | 
			
		||||
		pw_proxy_error((struct pw_proxy*)c->node, res, spa_strerror(res));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue