[systemd-devel] [PATCH] nspawn: log out of memory errors

Lennart Poettering lennart at poettering.net
Tue Nov 5 09:07:21 PST 2013


On Tue, 05.11.13 15:26, Djalal Harouni (tixxdz at opendz.org) wrote:

Applied!

Thanks!

> ---
>  src/nspawn/nspawn.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
> index 1477456..80903a7 100644
> --- a/src/nspawn/nspawn.c
> +++ b/src/nspawn/nspawn.c
> @@ -224,6 +224,9 @@ static int parse_argv(int argc, char *argv[]) {
>  
>                  case 'S':
>                          arg_slice = strdup(optarg);
> +                        if (!arg_slice)
> +                                return log_oom();
> +
>                          break;
>  
>                  case 'M':
> @@ -315,11 +318,11 @@ static int parse_argv(int argc, char *argv[]) {
>  
>                          r = strv_extend(x, a);
>                          if (r < 0)
> -                                return r;
> +                                return log_oom();
>  
>                          r = strv_extend(x, b);
>                          if (r < 0)
> -                                return r;
> +                                return log_oom();
>  
>                          break;
>                  }


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list