[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] blkdebug: show an error for invalid event names
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] blkdebug: show an error for invalid event names |
Date: |
Mon, 22 Sep 2014 11:28:23 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sat, Sep 20, 2014 at 09:32:35AM +0000, Gonglei (Arei) wrote:
> > @@ -315,10 +320,21 @@ static int read_config(BDRVBlkdebugState *s, const
> > char *filename,
> >
> > d.s = s;
> > d.action = ACTION_INJECT_ERROR;
> > - qemu_opts_foreach(&inject_error_opts, add_rule, &d, 0);
> > + d.errp = &local_err;
> > + qemu_opts_foreach(&inject_error_opts, add_rule, &d, 1);
> > + if (local_err) {
> > + error_propagate(errp, local_err);
> > + ret = -EINVAL;
> > + goto fail;
> > + }
> >
>
> If this check failed, it don't need to reset &set_state_opts.
Setting up the rules has failed and we need to free the QemuOpts which
were built up in this function.
If we don't free them then there is a memory leak.
Why is it correct to avoid resetting set_state_opts?
Stefan
pgpgLNOTM1r1u.pgp
Description: PGP signature