summary refs log tree commit diff
path: root/src/settings/plugins/ibft/nms-ibft-reader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings/plugins/ibft/nms-ibft-reader.h')
-rw-r--r--src/settings/plugins/ibft/nms-ibft-reader.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/settings/plugins/ibft/nms-ibft-reader.h b/src/settings/plugins/ibft/nms-ibft-reader.h
index 27500cc5..baa81e99 100644
--- a/src/settings/plugins/ibft/nms-ibft-reader.h
+++ b/src/settings/plugins/ibft/nms-ibft-reader.h
@@ -23,6 +23,14 @@
 
 #include "nm-connection.h"
 
+static inline void
+_nm_auto_free_ibft_blocks (GSList **p_blocks)
+{
+	if (*p_blocks)
+		g_slist_free_full (*p_blocks, (GDestroyNotify) g_ptr_array_unref);
+}
+#define nm_auto_free_ibft_blocks nm_auto (_nm_auto_free_ibft_blocks)
+
 gboolean nms_ibft_reader_load_blocks (const char *iscsiadm_path,
                                       GSList **out_blocks,
                                       GError **error);