From a95ec1b046b02b51471f6740a9cf1ca0b4e5bcbb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 25 Mar 2008 11:18:57 +0000 Subject: [PATCH] Ensure that zero-length array translates to NULL git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3498 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- libnm-glib/nm-types.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libnm-glib/nm-types.c b/libnm-glib/nm-types.c index 8036952cec..4627713537 100644 --- a/libnm-glib/nm-types.c +++ b/libnm-glib/nm-types.c @@ -241,6 +241,10 @@ nm_object_array_demarshal (GValue *value, g_warning ("%s: couldn't create object for %s", __func__, path); } } + if (temp->len == 0) { + g_ptr_array_free (temp, TRUE); + temp = NULL; + } } /* Deallocate after to ensure that an object that might already