[Pkg-xen-changes] [xen] 47/48: tools: libxl: do not leak diskpath during local disk attach

Ian James Campbell ijc at moszumanska.debian.org
Tue Dec 9 12:49:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

ijc pushed a commit to branch feature/patch-names
in repository xen.

commit 90274d61ee5b9e0906a599446537b3216a3d3469
Author: Ian Campbell <ian.campbell at citrix.com>
Date:   Thu Nov 6 13:00:31 2014 +0000

    tools: libxl: do not leak diskpath during local disk attach
    
    libxl__device_disk_local_initiate_attach is assigning dls->diskpath with a
    strdup of the device path. This is then passed to the callback, e.g.
    parse_bootloader_result but bootloader_cleanup will not free it.
    
    Since the callback is within the scope of the (e)gc and therefore doesn't need
    to be malloc'd, a gc'd alloc will do. All other assignments to this field use
    the gc.
    
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=767295
    
    Reported-by: Gedalya <gedalya at gedalya.net>
    Signed-off-by: Ian Campbell <ian.campbell at citrix.com>
    Acked-by: Ian Jackson <ian.jackson at eu.citrix.com>
    Acked-by: Wei Liu <wei.liu2 at citrix.com>
    (cherry picked from commit 379b351889a8f02abe30a06e2ce9ba8b381b91ab)
    
    Patch-Name: libxl-local-attach-diskpath-leak.diff
---
 tools/libxl/libxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 2d29ad2..c47f957 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2678,7 +2678,7 @@ void libxl__device_disk_local_initiate_attach(libxl__egc *egc,
     }
 
     if (dev != NULL)
-        dls->diskpath = strdup(dev);
+        dls->diskpath = libxl__strdup(gc, dev);
 
     dls->callback(egc, dls, 0);
     return;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-xen/xen.git



More information about the Pkg-xen-changes mailing list