fixed potential crash incase of a bad stylesheet
authorIgor Zlatkovic <igor@src.gnome.org>
Sat, 31 May 2003 15:44:23 +0000 (15:44 +0000)
committerIgor Zlatkovic <igor@src.gnome.org>
Sat, 31 May 2003 15:44:23 +0000 (15:44 +0000)
libxslt/xslt.c

index 2750921..5bc3863 100644 (file)
@@ -1983,12 +1983,14 @@ xsltParseStylesheetImportedDoc(xmlDocPtr doc) {
        xsltFreeStylesheet(ret);
        ret = NULL;
     }
-    if (ret->errors != 0) {
-       ret->doc = NULL;
-       xsltFreeStylesheet(ret);
-       ret = NULL;
+    if (ret != NULL) {
+       if (ret->errors != 0) {
+           ret->doc = NULL;
+           xsltFreeStylesheet(ret);
+           ret = NULL;
+       }
     }
-
+    
     return(ret);
 }