Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100769 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36536 invoked from network); 25 Sep 2017 10:36:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Sep 2017 10:36:52 -0000 Authentication-Results: pb1.pair.com header.from=oneil@saxonica.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=oneil@saxonica.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain saxonica.com from 217.69.43.196 cause and error) X-PHP-List-Original-Sender: oneil@saxonica.com X-Host-Fingerprint: 217.69.43.196 UK1MAIL2513-b.mymailbank.co.uk Received: from [217.69.43.196] ([217.69.43.196:49214] helo=uk1mail2513-b.mymailbank.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/18-05407-F3CD8C95 for ; Mon, 25 Sep 2017 06:36:48 -0400 Received: from [10.0.0.7] (UnknownHost [82.152.109.221]) by uk1mail2513-d.mymailbank.co.uk with SMTP; Mon, 25 Sep 2017 11:36:30 +0100 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) In-Reply-To: Date: Mon, 25 Sep 2017 11:36:41 +0100 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: <4DE419BB-2630-44B8-B4E7-98E17BEBE749@saxonica.com> <29B0DEA4-2022-4656-8A61-C3D89DB8D5D2@saxonica.com> To: Sara Golemon X-Mailer: Apple Mail (2.3124) Subject: Re: [PHP-DEV] PHP extension - Saxon/C From: oneil@saxonica.com (O'Neil Delpratt) Ok. Thanks for taking a look. Potenial problem could be the following line: const char * objName =3DZSTR_VAL(Z_OBJCE_P(oth)->name); I think I need to free the objName some how. > On 22 Sep 2017, at 18:42, Sara Golemon wrote: >=20 >>> On Fri, Sep 22, 2017 at 12:21 PM, O'Neil Delpratt = wrote: >>> I still have the memory leak without that line. I think I was = thinking I need to add a refcount to the XdmNode object, but maybe I am = wrong. >>>=20 >> The Following gives leak: >>=20 >> $proc =3D Saxon/SaxonProcessor >>=20 >> $xquery =3D $proc->NewXQueryProcessor() >>=20 >> $sourceNode =3D $proc->parseXmlFromString("=E2=80=9D); >>=20 >> $xquery->setContextItem($sourceNode); // with this line commented out = there is no leak. >>=20 > Okay, well the bad news is that assuming the extension you're working > with is the link you gave initially and you did remove the > Z_ADDREF_P() from XQueryProcessor::setContextItem()... I can't point > to why you'd have a memory leak. >=20 > -Sara