summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/sqlite/src/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_sqlite/sqlite/src/hash.c')
-rw-r--r--ext/pdo_sqlite/sqlite/src/hash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/pdo_sqlite/sqlite/src/hash.c b/ext/pdo_sqlite/sqlite/src/hash.c
index 1c32c1b7c..8f34caba4 100644
--- a/ext/pdo_sqlite/sqlite/src/hash.c
+++ b/ext/pdo_sqlite/sqlite/src/hash.c
@@ -291,7 +291,7 @@ static void removeElementGivenHash(
if( pEntry->count<=0 ){
pEntry->chain = 0;
}
- if( pH->copyKey && elem->pKey ){
+ if( pH->copyKey ){
pH->xFree(elem->pKey);
}
pH->xFree( elem );
@@ -378,6 +378,9 @@ void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){
rehash(pH,8);
if( pH->htsize==0 ){
pH->count = 0;
+ if( pH->copyKey ){
+ pH->xFree(new_elem->pKey);
+ }
pH->xFree(new_elem);
return data;
}