Message ID | 20200814160241.7915-8-pannengyuan@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fix some error memleaks | expand |
Pan Nengyuan <pannengyuan@huawei.com> 于2020年8月14日周五 下午6:38写道: > > 'err' forgot to free in x86_cpu_class_check_missing_features error path. > Fix that. > > Reported-by: Euler Robot <euler.robot@huawei.com> > Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> > --- > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: Richard Henderson <rth@twiddle.net> > Cc: Eduardo Habkost <ehabkost@redhat.com> > --- > target/i386/cpu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/target/i386/cpu.c b/target/i386/cpu.c > index 588f32e136..4678aac0b4 100644 > --- a/target/i386/cpu.c > +++ b/target/i386/cpu.c > @@ -4872,6 +4872,7 @@ static void x86_cpu_class_check_missing_features(X86CPUClass *xcc, > new->value = g_strdup("type"); > *next = new; > next = &new->next; > + error_free(err); > } > > x86_cpu_filter_features(xc, false); > -- > 2.18.2 > >
diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 588f32e136..4678aac0b4 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4872,6 +4872,7 @@ static void x86_cpu_class_check_missing_features(X86CPUClass *xcc, new->value = g_strdup("type"); *next = new; next = &new->next; + error_free(err); } x86_cpu_filter_features(xc, false);
'err' forgot to free in x86_cpu_class_check_missing_features error path. Fix that. Reported-by: Euler Robot <euler.robot@huawei.com> Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com> --- Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Richard Henderson <rth@twiddle.net> Cc: Eduardo Habkost <ehabkost@redhat.com> --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion(+)