summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/admin.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/admin.c b/plugins/admin.c
index aea33cb71..02fec0456 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;