Fix crash in virsh connect command

This commit is contained in:
Daniel P. Berrange 2007-01-22 20:43:02 +00:00
parent e9371d1a46
commit d042d339d1
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Mon Jan 22 15:41:52 EST 2007 Daniel Berrange <berrange@redhat.com>
* src/virsh.c: Fix crash in 'connect' command by ensuring
we always strdup the connection URI string.
Mon Jan 22 16:23:52 IST 2007 Mark McLoughlin <markmc@redhat.com>
* src/internal.h: virDomain.handle refers to the "id"

View File

@ -292,7 +292,7 @@ cmdConnect(vshControl * ctl, vshCmd * cmd)
if (ctl->name)
free(ctl->name);
ctl->name = vshCommandOptString(cmd, "name", NULL);
ctl->name = vshStrdup(ctl, vshCommandOptString(cmd, "name", NULL));
if (!ro)
ctl->conn = virConnectOpen(ctl->name);