qapi: Fix regression with '-netdev help'
Commit e36c714e causes 'qemu -netdev help' to dump core, because the call to visit_end_union() is no longer conditional on whether *obj was allocated. Reported by Marc-André Lureau <marcandre.lureau@gmail.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1444861825-19256-1-git-send-email-eblake@redhat.com> [Commit message tweaked to say 'help' instead of '?'] Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
		
							parent
							
								
									c49d3411fa
								
							
						
					
					
						commit
						d08ac81a45
					
				@ -301,7 +301,9 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error
 | 
				
			|||||||
out_obj:
 | 
					out_obj:
 | 
				
			||||||
    error_propagate(errp, err);
 | 
					    error_propagate(errp, err);
 | 
				
			||||||
    err = NULL;
 | 
					    err = NULL;
 | 
				
			||||||
 | 
					    if (*obj) {
 | 
				
			||||||
        visit_end_union(v, !!(*obj)->data, &err);
 | 
					        visit_end_union(v, !!(*obj)->data, &err);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    error_propagate(errp, err);
 | 
					    error_propagate(errp, err);
 | 
				
			||||||
    err = NULL;
 | 
					    err = NULL;
 | 
				
			||||||
    visit_end_struct(v, &err);
 | 
					    visit_end_struct(v, &err);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user