qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qga: fix 'driver' leak in guest-get-fsinfo
@ 2018-07-05 16:16 Marc-André Lureau
  2018-07-05 17:43 ` Laszlo Ersek
  2018-07-06 13:21 ` Michael Roth
  0 siblings, 2 replies; 3+ messages in thread
From: Marc-André Lureau @ 2018-07-05 16:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: lersek, mdroth, Marc-André Lureau

'driver' is leaked when the loop is not broken.

Leak introduced by commit 743c71d03c20d64f2bae5fba6f26cdf5e4b1bda6,
spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 qga/commands-posix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 233f78a406..c46767b0dd 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -890,6 +890,7 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
             break;
         }
 
+        g_free(driver);
         if (sscanf(p, "/%x:%x:%x.%x%n",
                           pci, pci + 1, pci + 2, pci + 3, &pcilen) == 4) {
             p += pcilen;
-- 
2.18.0.rc1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qga: fix 'driver' leak in guest-get-fsinfo
  2018-07-05 16:16 [Qemu-devel] [PATCH] qga: fix 'driver' leak in guest-get-fsinfo Marc-André Lureau
@ 2018-07-05 17:43 ` Laszlo Ersek
  2018-07-06 13:21 ` Michael Roth
  1 sibling, 0 replies; 3+ messages in thread
From: Laszlo Ersek @ 2018-07-05 17:43 UTC (permalink / raw)
  To: Marc-André Lureau, qemu-devel; +Cc: mdroth

On 07/05/18 18:16, Marc-André Lureau wrote:
> 'driver' is leaked when the loop is not broken.
> 
> Leak introduced by commit 743c71d03c20d64f2bae5fba6f26cdf5e4b1bda6,
> spotted by ASAN.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  qga/commands-posix.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 233f78a406..c46767b0dd 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -890,6 +890,7 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
>              break;
>          }
>  
> +        g_free(driver);
>          if (sscanf(p, "/%x:%x:%x.%x%n",
>                            pci, pci + 1, pci + 2, pci + 3, &pcilen) == 4) {
>              p += pcilen;
> 

Sorry, I should have noticed this in review.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Laszlo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] qga: fix 'driver' leak in guest-get-fsinfo
  2018-07-05 16:16 [Qemu-devel] [PATCH] qga: fix 'driver' leak in guest-get-fsinfo Marc-André Lureau
  2018-07-05 17:43 ` Laszlo Ersek
@ 2018-07-06 13:21 ` Michael Roth
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Roth @ 2018-07-06 13:21 UTC (permalink / raw)
  To: Marc-André Lureau, qemu-devel; +Cc: lersek

Quoting Marc-André Lureau (2018-07-05 11:16:29)
> 'driver' is leaked when the loop is not broken.
> 
> Leak introduced by commit 743c71d03c20d64f2bae5fba6f26cdf5e4b1bda6,
> spotted by ASAN.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks, applied to qga tree:
  https://github.com/mdroth/qemu/commits/qga

> ---
>  qga/commands-posix.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 233f78a406..c46767b0dd 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -890,6 +890,7 @@ static void build_guest_fsinfo_for_real_device(char const *syspath,
>              break;
>          }
> 
> +        g_free(driver);
>          if (sscanf(p, "/%x:%x:%x.%x%n",
>                            pci, pci + 1, pci + 2, pci + 3, &pcilen) == 4) {
>              p += pcilen;
> -- 
> 2.18.0.rc1
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-06 13:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-05 16:16 [Qemu-devel] [PATCH] qga: fix 'driver' leak in guest-get-fsinfo Marc-André Lureau
2018-07-05 17:43 ` Laszlo Ersek
2018-07-06 13:21 ` Michael Roth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).