cvs: php4 /ext/xslt sablot.c
| From: | Melvyn Sopacua | Date: | Sat, 05 Oct 2002 14:04:18 +0000 |
| Subject: | cvs: php4 /ext/xslt sablot.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-14569@lists.php.net to get a copy of this message | ||
msopacua Sat Oct 5 10:04:18 2002 EDT
Modified files:
/php4/ext/xslt sablot.c
Log:
(xslt: error_print) Fixes a leak when multiple error messages are issued
during a transformation.
# It's probably better to wrap this in an internal function, since it's
# easily forgotten.
Index: php4/ext/xslt/sablot.c
diff -u php4/ext/xslt/sablot.c:1.55 php4/ext/xslt/sablot.c:1.56
--- php4/ext/xslt/sablot.c:1.55 Fri Oct 4 19:06:09 2002
+++ php4/ext/xslt/sablot.c Sat Oct 5 10:04:18 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sablot.c,v 1.55 2002/10/04 23:06:09 dviner Exp $ */
+/* $Id: sablot.c,v 1.56 2002/10/05 14:04:18 msopacua Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1632,6 +1632,10 @@
/* Allocate the message buffer and copy the data onto it */
msgbuf = emalloc((sizeof(msgformat) - 4) + strlen(errmsg) + strlen(errline) + 1);
sprintf(msgbuf, msgformat, errline, errmsg);
+
+ /* If an old message exists, remove it -> leak */
+ if (XSLT_ERRSTR(handle))
+ efree(XSLT_ERRSTR(handle));
/* Copy the error message onto the handle for use when
the xslt_error function is called */