If you are pushing data onto the list that already exists, then return success.

Do not push the data in a second time.
This commit is contained in:
Dan Walsh 2013-10-09 16:51:22 -04:00 committed by Stephen Smalley
parent 56d9d20a64
commit 6f84cfd00c
1 changed files with 4 additions and 0 deletions

View File

@ -140,6 +140,10 @@ int semanage_list_push(semanage_list_t ** list, char *data)
if (!data) if (!data)
return EINVAL; return EINVAL;
if (semanage_list_find(*list, data) != NULL)
return 0;
if (!(temp = malloc(sizeof(semanage_list_t)))) if (!(temp = malloc(sizeof(semanage_list_t))))
return ENOMEM; return ENOMEM;