[systemd-devel] [PATCH 1/3] unit: check correct variable after strdup

Lennart Poettering lennart at poettering.net
Thu Jul 11 16:19:30 PDT 2013


On Tue, 09.07.13 15:45, Lukas Nykryn (lnykryn at redhat.com) wrote:

Applied all three! Thanks!
> ---
>  src/core/unit.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/core/unit.c b/src/core/unit.c
> index 447f201..b3f9832 100644
> --- a/src/core/unit.c
> +++ b/src/core/unit.c
> @@ -2302,7 +2302,7 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
>                          char *s;
>  
>                          s = strdup(v);
> -                        if (!v)
> +                        if (!s)
>                                  return -ENOMEM;
>  
>                          free(u->cgroup_path);


Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list