[Pkg-libvirt-commits] [libguestfs] 45/72: v2v: xml: Remove dependency on libguestfs internals.
Hilko Bengen
bengen at moszumanska.debian.org
Sun Apr 5 15:19:51 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch master
in repository libguestfs.
commit 3c19ff2b090278b5e01f36753c33e8c1113395d4
Author: Richard W.M. Jones <rjones at redhat.com>
Date: Fri Mar 6 17:02:58 2015 +0000
v2v: xml: Remove dependency on libguestfs internals.
This is just so I can share the code with the virt-v2v external tests.
(cherry picked from commit ce5a51a34c2667ed89d0e184d770f96d0283c001)
---
v2v/xml-c.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/v2v/xml-c.c b/v2v/xml-c.c
index 0b619e5..2c215ca 100644
--- a/v2v/xml-c.c
+++ b/v2v/xml-c.c
@@ -34,9 +34,6 @@
#include <libxml/xpathInternals.h>
#include <libxml/uri.h>
-#include "guestfs.h"
-#include "guestfs-internal-frontend.h"
-
#pragma GCC diagnostic ignored "-Wmissing-prototypes"
/* xmlDocPtr type */
@@ -243,9 +240,10 @@ value
v2v_xml_node_ptr_as_string (value docv, value nodev)
{
CAMLparam2 (docv, nodev);
+ CAMLlocal1 (strv);
xmlDocPtr doc = Doc_val (docv);
xmlNodePtr node = (xmlNodePtr) nodev;
- CLEANUP_FREE char *str = NULL;
+ char *str;
switch (node->type) {
case XML_TEXT_NODE:
@@ -261,7 +259,9 @@ v2v_xml_node_ptr_as_string (value docv, value nodev)
if (str == NULL)
caml_invalid_argument ("node_as_string: xmlNodeListGetString cannot convert node to string");
- CAMLreturn (caml_copy_string (str));
+ strv = caml_copy_string (str);
+ free (str);
+ CAMLreturn (strv);
default:
caml_invalid_argument ("node_as_string: don't know how to convert this node to a string");
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list