aboutsummaryrefslogtreecommitdiffstats
path: root/xmlwriter.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2014-02-08 02:22:35 +0800
committerDaniel Veillard <veillard@redhat.com>2014-02-08 02:23:27 +0800
commitc9ecf45d1bf4ed9bdfed7f9733687a4df1daf897 (patch)
tree657d5fb3a71e0d9d39870bdf4904a47e7d49c1da /xmlwriter.c
parent190a0b89395f397b40aea02de6f362290ad6cc3d (diff)
downloadandroid_external_libxml2-c9ecf45d1bf4ed9bdfed7f9733687a4df1daf897.tar.gz
android_external_libxml2-c9ecf45d1bf4ed9bdfed7f9733687a4df1daf897.tar.bz2
android_external_libxml2-c9ecf45d1bf4ed9bdfed7f9733687a4df1daf897.zip
Fix xmlTextWriterWriteElement when a null content is given
Diffstat (limited to 'xmlwriter.c')
-rw-r--r--xmlwriter.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/xmlwriter.c b/xmlwriter.c
index 2e21d1ba..fac20ac0 100644
--- a/xmlwriter.c
+++ b/xmlwriter.c
@@ -2242,10 +2242,12 @@ xmlTextWriterWriteElement(xmlTextWriterPtr writer, const xmlChar * name,
if (count == -1)
return -1;
sum += count;
- count = xmlTextWriterWriteString(writer, content);
- if (count == -1)
- return -1;
- sum += count;
+ if (content != NULL) {
+ count = xmlTextWriterWriteString(writer, content);
+ if (count == -1)
+ return -1;
+ sum += count;
+ }
count = xmlTextWriterEndElement(writer);
if (count == -1)
return -1;