[PATCH 3/4] getgrent.c: Fix Unchecked return value error (CID #1459004)

Gedare Bloom gedare at rtems.org
Fri Feb 26 21:55:57 UTC 2021


On Fri, Feb 26, 2021 at 2:35 PM Ryan Long <thisisryanlong at gmail.com> wrote:
>
> 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..534e04c 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);
add whitespace after comma

>  }
> --
> 1.8.3.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list