* Dr. David Alan Gilbert (dgilb...@redhat.com) wrote:
> * Eduardo Habkost (ehabk...@redhat.com) wrote:
> > Assigning directly to *errp is not valid, as errp may be NULL,
> > &error_fatal, or &error_abort.  Use error_propagate() instead.
> > 
> > Cc: Juan Quintela <quint...@redhat.com>
> > Cc: "Dr. David Alan Gilbert" <dgilb...@redhat.com>
> > Signed-off-by: Eduardo Habkost <ehabk...@redhat.com>
> > ---
> >  migration/migration.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/migration/migration.c b/migration/migration.c
> > index 48c94c9ca1..5a8bef3ef5 100644
> > --- a/migration/migration.c
> > +++ b/migration/migration.c
> > @@ -1188,7 +1188,7 @@ bool migration_is_blocked(Error **errp)
> >      }
> >  
> >      if (migration_blockers) {
> > -        *errp = error_copy(migration_blockers->data);
> > +        error_propagate(errp, error_copy(migration_blockers->data));
> >          return true;
> >      }
> 
> if errp is NULL doesn't that leak the error_copy ?

To answer myself, no it doesn't - error_propagate free's it in that
case.

Dave

> Dave
> 
> >  
> > -- 
> > 2.11.0.259.g40922b1
> > 
> --
> Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK
--
Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK

Reply via email to