[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xenpaging: do not leak if --pagefile given twice



commit 7e1e001fa7d9d9df300ced3fb83df5f12ebb722b
Author:     Ian Campbell <ian.campbell@xxxxxxxxxx>
AuthorDate: Wed Feb 17 14:58:33 2016 +0000
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CommitDate: Wed Feb 17 14:22:24 2016 -0500

    xenpaging: do not leak if --pagefile given twice
    
    By freeing filename (which is either NULL or the previous iteration of
    this argument). This implements a semantic where the last --pagefile
    given on the command line takes precedence.
    
    This is the same semantic as the other options have.
    
    CID: 1198792
    
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
    Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/xenpaging/xenpaging.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
index 0377507..6157d3a 100644
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -232,6 +232,7 @@ static int xenpaging_getopts(struct xenpaging *paging, int 
argc, char *argv[])
             paging->vm_event.domain_id = atoi(optarg);
             break;
         case 'f':
+            free(filename);
             filename = strdup(optarg);
             break;
         case 'm':
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.