From 87bfb48247dcfc11c4580426122100c27793dab8 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 27 Oct 2020 19:33:06 +0100 Subject: [PATCH] Improvements --- php_pq.h | 2 +- src/php_pqres.c | 2 +- src/php_pqres.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/php_pq.h b/php_pq.h index 175506e..a422b6a 100644 --- a/php_pq.h +++ b/php_pq.h @@ -14,7 +14,7 @@ #ifndef PHP_PQ_H #define PHP_PQ_H -#define PHP_PQ_VERSION "2.1.10dev" +#define PHP_PQ_VERSION "2.1.9dev" #ifdef PHP_WIN32 # define PHP_PQ_API __declspec(dllexport) diff --git a/src/php_pqres.c b/src/php_pqres.c index 6f32f73..edc8de2 100644 --- a/src/php_pqres.c +++ b/src/php_pqres.c @@ -165,7 +165,7 @@ zval *php_pqres_typed_zval(php_pqres_t *res, Oid typ, zval *zv) ZVAL_NULL(zv); } else { ZVAL_STRINGL(zv, unescaped_str, unescaped_len); - free(unescaped_str); + PQfreemem(unescaped_str); } break; case PHP_PQ_OID_INT8: diff --git a/src/php_pqres.h b/src/php_pqres.h index b8ebab4..79507fd 100644 --- a/src/php_pqres.h +++ b/src/php_pqres.h @@ -25,10 +25,10 @@ typedef enum php_pqres_fetch { #define PHP_PQRES_CONV_BOOL 0x0001 #define PHP_PQRES_CONV_INT 0x0002 #define PHP_PQRES_CONV_FLOAT 0x0004 +#define PHP_PQRES_CONV_BYTEA 0x0008 #define PHP_PQRES_CONV_SCALAR 0x000f #define PHP_PQRES_CONV_ARRAY 0x0010 #define PHP_PQRES_CONV_DATETIME 0x0020 -#define PHP_PQRES_CONV_BYTEA 0x0030 #define PHP_PQRES_CONV_JSON 0x0100 #define PHP_PQRES_CONV_ALL 0xffff