mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	fix modargs memory leak
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@68 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									1416fef197
								
							
						
					
					
						commit
						ed9bd5f01f
					
				
					 4 changed files with 19 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -107,23 +107,30 @@ struct pa_socket_server *create_socket_server(struct pa_core *c, struct pa_modar
 | 
			
		|||
 | 
			
		||||
int pa_module_init(struct pa_core *c, struct pa_module*m) {
 | 
			
		||||
    struct pa_socket_server *s;
 | 
			
		||||
    struct pa_modargs *ma;
 | 
			
		||||
    struct pa_modargs *ma = NULL;
 | 
			
		||||
    int ret = -1;
 | 
			
		||||
    assert(c && m);
 | 
			
		||||
 | 
			
		||||
    if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
 | 
			
		||||
        fprintf(stderr, "Failed to parse module arguments\n");
 | 
			
		||||
        return -1;
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (!(s = create_socket_server(c, ma)))
 | 
			
		||||
        return -1;
 | 
			
		||||
        goto finish;
 | 
			
		||||
 | 
			
		||||
    if (!(m->userdata = protocol_new(c, s, m, ma))) {
 | 
			
		||||
        pa_socket_server_free(s);
 | 
			
		||||
        return -1;
 | 
			
		||||
        goto finish;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
    ret = 0;
 | 
			
		||||
 | 
			
		||||
finish:
 | 
			
		||||
    if (ma)
 | 
			
		||||
        pa_modargs_free(ma);
 | 
			
		||||
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void pa_module_done(struct pa_core *c, struct pa_module*m) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue