[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] String properties defaults must be dynamically allocate
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] String properties defaults must be dynamically allocated |
Date: |
Wed, 17 Jun 2015 15:16:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
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