mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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@oracle.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
72c6bbe7ef
commit
7e1e001fa7
1 file changed
+1
@@ -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':
|
||||
|
||||