mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	fix some leaks
This commit is contained in:
		
							parent
							
								
									132ee30930
								
							
						
					
					
						commit
						30316df5c8
					
				
					 3 changed files with 14 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -161,6 +161,9 @@ static void *create_object(void *_data,
 | 
			
		|||
 | 
			
		||||
	pw_node_set_active(dsp, true);
 | 
			
		||||
 | 
			
		||||
	if (properties)
 | 
			
		||||
		pw_properties_free(properties);
 | 
			
		||||
 | 
			
		||||
	return dsp;
 | 
			
		||||
 | 
			
		||||
      no_resource:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -140,6 +140,8 @@ struct node {
 | 
			
		|||
	struct port *in_ports[MAX_INPUTS];
 | 
			
		||||
	struct port *out_ports[MAX_OUTPUTS];
 | 
			
		||||
 | 
			
		||||
	struct port dummy;
 | 
			
		||||
 | 
			
		||||
	uint32_t n_params;
 | 
			
		||||
	struct spa_pod **params;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1046,10 +1048,12 @@ client_node_port_update(void *data,
 | 
			
		|||
		clear_port(this, port);
 | 
			
		||||
		pw_node_update_ports(impl->this.node);
 | 
			
		||||
	} else {
 | 
			
		||||
		struct port dummy = { 0 }, *target;
 | 
			
		||||
		struct port *target;
 | 
			
		||||
 | 
			
		||||
		if (port == NULL)
 | 
			
		||||
			target = &dummy;
 | 
			
		||||
		if (port == NULL) {
 | 
			
		||||
			target = &this->dummy;
 | 
			
		||||
			spa_zero(this->dummy);
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
			target = port;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1061,11 +1065,11 @@ client_node_port_update(void *data,
 | 
			
		|||
		if (port == NULL) {
 | 
			
		||||
			if (direction == SPA_DIRECTION_INPUT) {
 | 
			
		||||
				this->n_inputs++;
 | 
			
		||||
				this->in_ports[port_id] = &dummy;
 | 
			
		||||
				this->in_ports[port_id] = target;
 | 
			
		||||
			}
 | 
			
		||||
			else {
 | 
			
		||||
				this->n_outputs++;
 | 
			
		||||
				this->out_ports[port_id] = &dummy;
 | 
			
		||||
				this->out_ports[port_id] = target;
 | 
			
		||||
			}
 | 
			
		||||
			pw_node_update_ports(impl->this.node);
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -119,11 +119,13 @@ static struct monitor_item *add_item(struct pw_spa_monitor *this,
 | 
			
		|||
					   &props->dict,
 | 
			
		||||
					   support,
 | 
			
		||||
					   n_support)) < 0) {
 | 
			
		||||
		pw_properties_free(props);
 | 
			
		||||
		pw_log_error("can't make factory instance: %d", res);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	if ((res = spa_handle_get_interface(handle, SPA_TYPE_INTERFACE_Node, &node_iface)) < 0) {
 | 
			
		||||
		pw_log_error("can't get NODE interface: %d", res);
 | 
			
		||||
		pw_properties_free(props);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue