virsh: modify vshStringToArray to duplicate the elements too

At a slightly larger memory expense allow stealing of items from the
string array returned from vshStringToArray and turn the result into a
string list compatible with virStringSplit. This will allow to use the
common dealloc function.

This patch also fixes a few forgotten checks of return from
vshStringToArray and one memory leak.
This commit is contained in:
Peter Krempa
2013-08-20 17:53:49 +02:00
parent a7f94a40bb
commit d64af6ce3c
5 changed files with 20 additions and 34 deletions
+1
View File
@@ -37,6 +37,7 @@
# include "virerror.h"
# include "virthread.h"
# include "virnetdevbandwidth.h"
# include "virstring.h"
# define VSH_MAX_XML_FILE (10*1024*1024)