From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5DDU-0005CG-H7 for Qemu-devel@nongnu.org; Wed, 17 Jun 2015 09:17:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5DDO-0008By-Cj for Qemu-devel@nongnu.org; Wed, 17 Jun 2015 09:17:19 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:34275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5DDO-0008Bq-6x for Qemu-devel@nongnu.org; Wed, 17 Jun 2015 09:17:14 -0400 Received: by wicnd19 with SMTP id nd19so82908165wic.1 for ; Wed, 17 Jun 2015 06:16:28 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5581732A.9080901@redhat.com> Date: Wed, 17 Jun 2015 15:16:26 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] String properties defaults must be dynamically allocated List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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