Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id AFC651337B85 for ; Thu, 25 Nov 2010 11:11:46 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 54575-01-8 for ; Thu, 25 Nov 2010 15:11:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og127.obsmtp.com (exprod7og127.obsmtp.com [64.18.2.210]) by mail.postgresql.org (Postfix) with SMTP id CAC881337BA2 for ; Thu, 25 Nov 2010 11:11:10 -0400 (AST) Received: from source ([209.85.215.170]) by exprod7ob127.postini.com ([64.18.6.12]) with SMTP ID DSNKTO58jlA2EdrsGNQgTM/rLUHktspkQsIk@postini.com; Thu, 25 Nov 2010 07:11:12 PST Received: by mail-ey0-f170.google.com with SMTP id 5so478490eyf.1 for ; Thu, 25 Nov 2010 07:11:10 -0800 (PST) Received: by 10.213.114.78 with SMTP id d14mr2548894ebq.93.1290697870583; Thu, 25 Nov 2010 07:11:10 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id x54sm779114eeh.17.2010.11.25.07.11.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 25 Nov 2010 07:11:09 -0800 (PST) Message-ID: <4CEE7C87.50909@enterprisedb.com> Date: Thu, 25 Nov 2010 17:11:03 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 To: Helmar Spangenberg CC: pgsql-bugs@postgresql.org Subject: Re: BUG #5769: Problem with SPI_getvalue References: <201011251145.oAPBjweK020676@wwwmaster.postgresql.org> In-Reply-To: <201011251145.oAPBjweK020676@wwwmaster.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201011/163 X-Sequence-Number: 28743 On 25.11.2010 13:45, Helmar Spangenberg wrote: > Bug reference: 5769 > Logged by: Helmar Spangenberg > Email address: hspangenberg@frey.de > PostgreSQL version: 9.0.1 > Operating system: Linux > Description: Problem with SPI_getvalue > Details: > > Referring to the manual, I can pfree the result returned by SPI_getvalue. > However the backend crashes as soon as I use pfree. > > No example uses pfree. Could it be possible, there is a bug in the > documentation? The return value of SPI_getvalue is certainly palloc()'d, so pfree()ing it should not crash. Perhaps you are trying to pfree() it after the whole memory context has already been destroyed. Or perhaps SPI_getvalue returned a NULL and you're trying to pfree() that. Can't say without more details. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com