Diff between fc77feb09195bd22d34e7cd8278d0123b6b3c061 and 355d06b3f32147c1dfa39bfd1cd2d4e346b65492

Changed Files

File Additions Deletions Status
plugins/admin.c +6 -1 modified

Full Patch

diff --git a/plugins/admin.c b/plugins/admin.c
index aea33cb..02fec04 100644
--- a/plugins/admin.c
+++ b/plugins/admin.c
@@ -196,12 +196,17 @@ static char **new_uuid_strings(struct queue *allowlist, gsize *num)
 	char **uuid_strs = NULL;
 	gsize i = 0, allowlist_num;
 
+	allowlist_num = queue_length(allowlist);
+	if (!allowlist_num) {
+		*num = 0;
+		return NULL;
+	}
+
 	/* Set num to a non-zero number so that whoever call this could know if
 	 * this function success or not
 	 */
 	*num = 1;
 
-	allowlist_num = queue_length(allowlist);
 	uuid_strs = g_try_malloc_n(allowlist_num, sizeof(char *));
 	if (!uuid_strs)
 		return NULL;