NetworkManager/src/devices/ovs
Thomas Haller f0442a47ed all: avoid calling g_free on a const pointer with g_clear_pointer()
With g_clear_pointer(pptr, g_free), pptr is cast to a non-const pointer,
and hence there is no compiler warning about calling g_free() in a const
pointer. However, it still feels ugly to pass a const pointer to
g_clear_pointer(). We should either add an explicity cast, or just
make the pointer non-const.

I guess part of the problem is that C's "const char *" means that the
string itself is immutable, but also that it cannot be freed. We most
often want a different semantic: the string itself is immutable after
being initialized once, but the memory itself can and will be freed.
Such a notion of immutable C strings cannot be expressed.

For that, just remove the "const" from the declarations. Although we
don't want to modify the (content of the) string, it's still more a
mutable string.

Only in _vt_cmd_obj_copy_lnk_vlan(), add an explicity cast but keep the
type as const. The reason is, that we really want that NMPObject
instances are immutable (in the sense that they don't modify while
existing), but that doesn't mean the memory cannot be freed.
2018-03-19 15:45:46 +01:00
..
meson.build core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API 2018-03-12 18:37:08 +01:00
nm-device-ovs-bridge.c core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API 2018-03-12 18:37:08 +01:00
nm-device-ovs-bridge.h device: add support for OpenVSwitch devices 2017-10-30 21:46:55 +01:00
nm-device-ovs-interface.c core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API 2018-03-12 18:37:08 +01:00
nm-device-ovs-interface.h device: add support for OpenVSwitch devices 2017-10-30 21:46:55 +01:00
nm-device-ovs-port.c core/dbus: rework D-Bus implementation to use lower layer GDBusConnection API 2018-03-12 18:37:08 +01:00
nm-device-ovs-port.h device: add support for OpenVSwitch devices 2017-10-30 21:46:55 +01:00
nm-ovs-factory.c device: add support for OpenVSwitch devices 2017-10-30 21:46:55 +01:00
nm-ovsdb.c all: avoid calling g_free on a const pointer with g_clear_pointer() 2018-03-19 15:45:46 +01:00
nm-ovsdb.h device: add support for OpenVSwitch devices 2017-10-30 21:46:55 +01:00