mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	gst: fix stream params memory leak
Both the GPtrArray and its contents are leaked in case of success. `pw_stream_connect()` copies the params as needed, so use `g_autoptr()` to free the array and with it, its contents.
This commit is contained in:
		
							parent
							
								
									c8efa0fae2
								
							
						
					
					
						commit
						2bc5d0914d
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
					@ -591,7 +591,7 @@ static gboolean
 | 
				
			||||||
gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
 | 
					gst_pipewire_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  GstPipeWireSink *pwsink;
 | 
					  GstPipeWireSink *pwsink;
 | 
				
			||||||
  GPtrArray *possible;
 | 
					  g_autoptr(GPtrArray) possible = NULL;
 | 
				
			||||||
  enum pw_stream_state state;
 | 
					  enum pw_stream_state state;
 | 
				
			||||||
  const char *error = NULL;
 | 
					  const char *error = NULL;
 | 
				
			||||||
  gboolean res = FALSE;
 | 
					  gboolean res = FALSE;
 | 
				
			||||||
| 
						 | 
					@ -696,7 +696,6 @@ start_error:
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    GST_ERROR ("could not start stream: %s", error);
 | 
					    GST_ERROR ("could not start stream: %s", error);
 | 
				
			||||||
    pw_thread_loop_unlock (pwsink->core->loop);
 | 
					    pw_thread_loop_unlock (pwsink->core->loop);
 | 
				
			||||||
    g_ptr_array_unref (possible);
 | 
					 | 
				
			||||||
    return FALSE;
 | 
					    return FALSE;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue