bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Uncouple netfs_make_protid (netfs_make_peropen()) function c


From: Samuel Thibault
Subject: Re: [PATCH] Uncouple netfs_make_protid (netfs_make_peropen()) function calls in Hurd.
Date: Fri, 28 Jan 2022 00:00:14 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Svante Signell, le jeu. 27 janv. 2022 23:07:34 +0100, a ecrit:
> @@ -47,6 +53,7 @@ netfs_make_peropen (struct node *np, int flags, struct 
> peropen *context)
>         po->path = strdup (context->path);
>         if (! po->path) {
>           free(po);
> +         errno = ENOMEM;
>           return NULL;
>         }
>       }

Ah, also, here: rather than hardcoding ENOMEM, save the errno value, and
restore it after calling free(po). strdup would normally only ever
return ENOMEM errors, but better be safe than sorry.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]