]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
util: fix the VIR_STRDUP when src is NULL
authoryangdongsheng <yangds.fnst@cn.fujitsu.com>
Tue, 28 May 2013 07:13:17 +0000 (15:13 +0800)
committerEric Blake <eblake@redhat.com>
Tue, 28 May 2013 11:57:01 +0000 (05:57 -0600)
commit2da3bc646e6fd1d07f4a663e8efaef8c7e0ba310
treebf09b1d2de4d5d9e7e097371d2c61cb9a889a7b2
parentc6f2523fb168e39232039766aa0287b5fbb77b5f
util: fix the VIR_STRDUP when src is NULL

When src is NULL, VIR_STRDUP will return 0 directly.
This patch will set dest to NULL before VIR_STRDUP return.

Example:
[root@yds-pc libvirt]# virsh
Welcome to virsh, the virtualization interactive terminal.

Type: 'help' for help with commands
'quit' to quit

virsh # connect
error: Failed to connect to the hypervisor
error: internal error Unable to parse URI �N�*

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/virstring.c