* [Qemu-devel] String properties defaults must be dynamically allocated
@ 2015-06-17 11:38 Liviu Ionescu
2015-06-17 13:16 ` Paolo Bonzini
0 siblings, 1 reply; 2+ messages in thread
From: Liviu Ionescu @ 2015-06-17 11:38 UTC (permalink / raw)
To: QEMU Developers
I don't know if this is a bug or a feature (to me it looks like a bug), but if the string pointer associated with a string property is initialised during inits with a pointer to a static string, the next qdev_prop_set_string() will fail attempting to free the static object.
the workaround is to g_strdup() the default static string.
regards,
Liviu
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] String properties defaults must be dynamically allocated
2015-06-17 11:38 [Qemu-devel] String properties defaults must be dynamically allocated Liviu Ionescu
@ 2015-06-17 13:16 ` Paolo Bonzini
0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2015-06-17 13:16 UTC (permalink / raw)
To: Liviu Ionescu, QEMU Developers
On 17/06/2015 13:38, Liviu Ionescu wrote:
> I don't know if this is a bug or a feature (to me it looks like a
> bug), but if the string pointer associated with a string property is
> initialised during inits with a pointer to a static string, the next
> qdev_prop_set_string() will fail attempting to free the static
> object.
>
> the workaround is to g_strdup() the default static string.
It's neither a bug nor a feature. You can just use
qdev_prop_set_string() itself to initialize the property.
Paolo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-06-17 13:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 11:38 [Qemu-devel] String properties defaults must be dynamically allocated Liviu Ionescu
2015-06-17 13:16 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.