dbus_message_get_args memory allocation in old versions

Tony Houghton h at realh.co.uk
Sun Apr 24 13:47:41 PDT 2005


I'm updating ROX-Session to work with dbus 0.3x and found that it was
calling g_free on a string returned by dbus_message_get_args. This is
definitely wrong with dbus 0.3x, as the docs show, and it was crashing.
But it had been working without apparent symptoms with 0.2x, whose docs
don't mention where the memory comes from. I want to keep backwards
compatibility for now, and if it was supposed to be freed in 0.2x I'll
create a memory leak by not freeing it. So can anyone tell me whether it
was ever right to free the string? I tried looking at the source, but
got a bit lost in the marshalling stuff. Even if it should be freed, I
think using g_free was technically wrong anyway and it should really be
dbus_free.

-- 
TH * http://www.realh.co.uk


More information about the dbus mailing list