check for NULL to prevent crash with meta elements
* xmlsave.c: check for NULL to prevent crash with meta elements
diff --git a/xmlsave.c b/xmlsave.c
index 943a84b..571427d 100644
--- a/xmlsave.c
+++ b/xmlsave.c
@@ -1216,11 +1216,13 @@
xmlChar *httpequiv;
httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv");
- if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) {
+ if (httpequiv != NULL) {
+ if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) {
+ xmlFree(httpequiv);
+ break;
+ }
xmlFree(httpequiv);
- break;
}
- xmlFree(httpequiv);
}
tmp = tmp->next;
}