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:
Ian Campbell authored and Konrad Rzeszutek Wilk committed 2016-02-17 14:22:24 -05:00
1 parent 72c6bbe7ef
commit 7e1e001fa7
1 file changed
+1
+1
View File
@@ -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':
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.