On Tue, 25.12.12 13:46, Thomas Jarosch (thomas.jaro...@intra2net.com) wrote:

> Detected by cppcheck
> 
> Signed-off-by: Thomas Jarosch <thomas.jaro...@intra2net.com>
> ---
>  src/tmpfiles/tmpfiles.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
> index c27d011..d8fb07e 100644
> --- a/src/tmpfiles/tmpfiles.c
> +++ b/src/tmpfiles/tmpfiles.c
> @@ -507,8 +507,10 @@ static int write_one_file(Item *i, const char *path) {
>                  _cleanup_free_ char *unescaped;
>  
>                  unescaped = cunescape(i->argument);
> -                if (unescaped == NULL)
> +                if (unescaped == NULL) {
> +                        close_nointr_nofail(fd);
>                          return log_oom();
> +                }
>  
>                  l = strlen(unescaped);
>                  n = write(fd, unescaped, l);

Thanks! Applied!


Lennart

-- 
Lennart Poettering - Red Hat, Inc.
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to