From 6f84cfd00ccd828cc87fae5ccbfd4cd5babad320 Mon Sep 17 00:00:00 2001 From: Dan Walsh Date: Wed, 9 Oct 2013 16:51:22 -0400 Subject: [PATCH] If you are pushing data onto the list that already exists, then return success. Do not push the data in a second time. --- libsemanage/src/utilities.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsemanage/src/utilities.c b/libsemanage/src/utilities.c index 349a4be9..a340fc85 100644 --- a/libsemanage/src/utilities.c +++ b/libsemanage/src/utilities.c @@ -140,6 +140,10 @@ int semanage_list_push(semanage_list_t ** list, char *data) if (!data) return EINVAL; + + if (semanage_list_find(*list, data) != NULL) + return 0; + if (!(temp = malloc(sizeof(semanage_list_t)))) return ENOMEM;