NetworkManager/libnm-fix-introspection-ann...

50 lines
1.7 KiB
Diff

From ba46efd07777350be737dbdac9df9becb86e8f77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes@redhat.com>
Date: Mon, 12 Oct 2015 10:56:44 +0200
Subject: [PATCH] libnm: specify (transfer none) introspection annotation (bgo
#756380)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Otherwise the callers would free the address and it would result in
double-free.
Ideally, the function would return const pointer, but changing it now
would require changing also other prototypes and much code due to
snowball effect of const.
https://bugzilla.gnome.org/show_bug.cgi?id=756380
(cherry picked from commit 237030ce2bc23f39ccb4f72f94b3c98e2232ded4)
Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
---
libnm-core/nm-setting-ip-config.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libnm-core/nm-setting-ip-config.c b/libnm-core/nm-setting-ip-config.c
index 4b73d5f..58b5799 100644
--- a/libnm-core/nm-setting-ip-config.c
+++ b/libnm-core/nm-setting-ip-config.c
@@ -1415,7 +1415,7 @@ nm_setting_ip_config_get_num_addresses (NMSettingIPConfig *setting)
* @setting: the #NMSettingIPConfig
* @i: index number of the address to return
*
- * Returns: the address at index @i
+ * Returns: (transfer none): the address at index @i
**/
NMIPAddress *
nm_setting_ip_config_get_address (NMSettingIPConfig *setting, int i)
@@ -1567,7 +1567,7 @@ nm_setting_ip_config_get_num_routes (NMSettingIPConfig *setting)
* @setting: the #NMSettingIPConfig
* @i: index number of the route to return
*
- * Returns: the route at index @i
+ * Returns: (transfer none): the route at index @i
**/
NMIPRoute *
nm_setting_ip_config_get_route (NMSettingIPConfig *setting, int i)
--
2.1.0