[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] dump:Add close fd on error return to avoid resource leak
|
From: |
Marc-André Lureau |
|
Subject: |
Re: [PATCH] dump:Add close fd on error return to avoid resource leak |
|
Date: |
Tue, 7 Nov 2023 15:54:58 +0400 |
On Tue, Nov 7, 2023 at 3:48 PM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> On 7/11/23 03:44, Zongmin Zhou wrote:
> > Signed-off-by: Zongmin Zhou<zhouzongmin@kylinos.cn>
> > ---
> > dump/dump.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/dump/dump.c b/dump/dump.c
> > index 1c304cadfd..ad5294e853 100644
> > --- a/dump/dump.c
> > +++ b/dump/dump.c
> > @@ -2160,6 +2160,7 @@ void qmp_dump_guest_memory(bool paging, const char
> > *protocol,
> > return;
> > }
> > if (kdump_raw && lseek(fd, 0, SEEK_CUR) == (off_t) -1) {
> > + close(fd);
> > error_setg(errp, "kdump-raw formats require a seekable file");
> > return;
> > }
>
> Since I'm preparing a PR, I'm queuing this patch, thanks!
>
ack, thanks
--
Marc-André Lureau