mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	media-session: don't write to freed memory in sm_object_destroy
Unref of node->handle may also free obj, if it was created by init_object.
This commit is contained in:
		
							parent
							
								
									7ae1ea1420
								
							
						
					
					
						commit
						d87f838e09
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -317,13 +317,13 @@ int sm_object_destroy(struct sm_object *obj)
 | 
				
			||||||
		spa_list_remove(&d->link);
 | 
							spa_list_remove(&d->link);
 | 
				
			||||||
		free(d);
 | 
							free(d);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (p)
 | 
					 | 
				
			||||||
		pw_proxy_unref(p);
 | 
					 | 
				
			||||||
	if (h)
 | 
					 | 
				
			||||||
		pw_proxy_unref(h);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	obj->proxy = NULL;
 | 
						obj->proxy = NULL;
 | 
				
			||||||
	obj->handle = NULL;
 | 
						obj->handle = NULL;
 | 
				
			||||||
 | 
						if (p)
 | 
				
			||||||
 | 
							pw_proxy_unref(p);
 | 
				
			||||||
 | 
						if (h)
 | 
				
			||||||
 | 
							pw_proxy_unref(h);  /* may free obj, if from init_object */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue