<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.113 2003/03/20 06:23:30 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/libpq.sgml,v 1.114 2003/03/22 03:29:05 momjian Exp $
-->
<chapter id="libpq">
</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><function>PQfreemem</function></term>
+ <listitem>
+ <para>
+ Frees memory allocated by <application>libpq</>
+<synopsis>
+void PQfreemem(void *ptr);
+</synopsis>
+</para>
+
+<para>
+ Frees memory allocated by <application>libpq</>, particularly
+ <function>PQescapeBytea</function> and <function>PQunescapeBytea</function>.
+ It is needed by Win32, which can not free memory across
+ DLL's, unless multithreaded DLL's (/MD in VC6) are used.
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</sect2>
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.126 2003/03/10 22:28:21 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.127 2003/03/22 03:29:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
return buffer;
}
+
+/*
+ * PQfreemem - safely frees memory allocated
+ *
+ * Needed mostly by Win32, unless multithreaded DLL (/MD in VC6)
+ * Used for freeing memory from PQescapeByte()a/PQunescapeBytea()
+ */
+void PQfreemem(void *ptr)
+{
+ free(ptr);
+}
+
+
/* ----------------
* Space management for PGresult.
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: libpq-fe.h,v 1.89 2003/03/20 06:23:30 momjian Exp $
+ * $Id: libpq-fe.h,v 1.90 2003/03/22 03:29:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
size_t *bytealen);
extern unsigned char *PQunescapeBytea(const unsigned char *strtext,
size_t *retbuflen);
+extern void PQfreemem(void *ptr);
/* Simple synchronous query */