[SSSD] [PATCH] LDAP: end on ENOMEM

Pavel Březina pbrezina at redhat.com
Mon Aug 24 11:19:00 UTC 2015


On 08/24/2015 01:11 PM, Pavel Reichl wrote:
> Hello,
>
> please see trivial patch fixing coverity warning.
>
> Thanks!
>
> 0001-LDAP-end-on-ENOMEM.patch
>
>
>  From 69c20ca306827a558d6be015d0d060f9f46423f8 Mon Sep 17 00:00:00 2001
> From: Pavel Reichl<preichl at redhat.com>
> Date: Mon, 24 Aug 2015 07:05:00 -0400
> Subject: [PATCH] LDAP: end on ENOMEM
>
> ---
>   src/providers/ldap/ldap_id_cleanup.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c
> index 0a2b23297f5feaee30b75b31a9b2fd9a0a2a6f23..0cbcf04791abe701d335523302e5c1f1afacc716 100644
> --- a/src/providers/ldap/ldap_id_cleanup.c
> +++ b/src/providers/ldap/ldap_id_cleanup.c
> @@ -466,6 +466,7 @@ get_group_dn_with_filter_sanitized_name(TALLOC_CTX *mem_ctx,
>       tmp_ctx = talloc_new(NULL);
>       if (tmp_ctx == NULL) {
>           ret = ENOMEM;
> +        goto done;

We usually use return ENOMEM in this case. But this works as well and it 
may be even clearer. Ack.

>       }
>
>       /* sanitize group name */
> -- 2.4.3
>
>
>
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
>




More information about the sssd-devel mailing list