[rtems commit] getgrent.c: Fix Unchecked return value error (CID #1459004)

Joel Sherrill joel at rtems.org
Fri Feb 26 22:56:15 UTC 2021


Module:    rtems
Branch:    master
Commit:    e5e58da6dfbdfa78ad499c2f52ec53c88538aa1c
Changeset: http://git.rtems.org/rtems/commit/?id=e5e58da6dfbdfa78ad499c2f52ec53c88538aa1c

Author:    Ryan Long <ryan.long at oarcorp.com>
Date:      Fri Feb 19 17:30:13 2021 -0500

getgrent.c: Fix Unchecked return value error (CID #1459004)

CID 1459004: Unchecked return value in endgrent().

Closes #4261

---

 cpukit/libcsupport/src/getgrent.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/cpukit/libcsupport/src/getgrent.c b/cpukit/libcsupport/src/getgrent.c
index b358cb9..de56430 100644
--- a/cpukit/libcsupport/src/getgrent.c
+++ b/cpukit/libcsupport/src/getgrent.c
@@ -95,6 +95,7 @@ void setgrent(void)
 void endgrent(void)
 {
   grp_context *ctx = grp_get_context();
+  int          sc;
 
   if (ctx == NULL)
     return;
@@ -104,5 +105,6 @@ void endgrent(void)
   }
 
   free(ctx);
-  pthread_setspecific(grp_key, NULL);
+  sc = pthread_setspecific(grp_key, NULL);
+  _Assert_Unused_variable_equals(sc, 0);
 }



More information about the vc mailing list