All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] 9pfs: xattr: fix memory leak in v9fs_list_xattr
@ 2017-04-07 10:48 Li Qiang
  2017-04-10  9:14 ` Greg Kurz
  0 siblings, 1 reply; 2+ messages in thread
From: Li Qiang @ 2017-04-07 10:48 UTC (permalink / raw)
  To: groug; +Cc: qemu-devel, ppandit, Li Qiang

Free 'orig_value' in error path.

Signed-off-by: Li Qiang <liqiang6-s@360.cn>
---
 hw/9pfs/9p-xattr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/9pfs/9p-xattr.c b/hw/9pfs/9p-xattr.c
index eec160b..d05c1a1 100644
--- a/hw/9pfs/9p-xattr.c
+++ b/hw/9pfs/9p-xattr.c
@@ -108,6 +108,7 @@ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path,
     g_free(name);
     close_preserve_errno(dirfd);
     if (xattr_len < 0) {
+        g_free(orig_value);
         return -1;
     }
 
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH] 9pfs: xattr: fix memory leak in v9fs_list_xattr
  2017-04-07 10:48 [Qemu-devel] [PATCH] 9pfs: xattr: fix memory leak in v9fs_list_xattr Li Qiang
@ 2017-04-10  9:14 ` Greg Kurz
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kurz @ 2017-04-10  9:14 UTC (permalink / raw)
  To: Li Qiang; +Cc: qemu-devel, ppandit, Li Qiang

[-- Attachment #1: Type: text/plain, Size: 696 bytes --]

On Fri,  7 Apr 2017 03:48:52 -0700
Li Qiang <liq3ea@gmail.com> wrote:

> Free 'orig_value' in error path.
> 
> Signed-off-by: Li Qiang <liqiang6-s@360.cn>
> ---

Good catch. I'll send a pull req later today.

Cheers.

--
Greg

>  hw/9pfs/9p-xattr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/9pfs/9p-xattr.c b/hw/9pfs/9p-xattr.c
> index eec160b..d05c1a1 100644
> --- a/hw/9pfs/9p-xattr.c
> +++ b/hw/9pfs/9p-xattr.c
> @@ -108,6 +108,7 @@ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path,
>      g_free(name);
>      close_preserve_errno(dirfd);
>      if (xattr_len < 0) {
> +        g_free(orig_value);
>          return -1;
>      }
>  


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

end of thread, other threads:[~2017-04-10  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-07 10:48 [Qemu-devel] [PATCH] 9pfs: xattr: fix memory leak in v9fs_list_xattr Li Qiang
2017-04-10  9:14 ` Greg Kurz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.