summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/sqlite/src/util.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2005-09-26 19:31:41 +0000
committerIlia Alshanetsky <iliaa@php.net>2005-09-26 19:31:41 +0000
commit94d1e563607f8aa9dee4e362d02e90b24db96aca (patch)
tree9bddb0952503e6baef4d0d6631cbfe6e3bfc032f /ext/pdo_sqlite/sqlite/src/util.c
parent74c7eb772384faf2e0c78e62f24f78fd875bf757 (diff)
downloadphp-git-94d1e563607f8aa9dee4e362d02e90b24db96aca.tar.gz
Update bundled libsqlite3 to version 3.2.7
Diffstat (limited to 'ext/pdo_sqlite/sqlite/src/util.c')
-rw-r--r--ext/pdo_sqlite/sqlite/src/util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/pdo_sqlite/sqlite/src/util.c b/ext/pdo_sqlite/sqlite/src/util.c
index a35a43fce3..de716d9820 100644
--- a/ext/pdo_sqlite/sqlite/src/util.c
+++ b/ext/pdo_sqlite/sqlite/src/util.c
@@ -367,6 +367,19 @@ char *sqlite3StrNDup(const char *z, int n){
#endif /* !defined(SQLITE_MEMDEBUG) */
/*
+** Reallocate a buffer to a different size. This is similar to
+** sqliteRealloc() except that if the allocation fails the buffer
+** is freed.
+*/
+void sqlite3ReallocOrFree(void **ppBuf, int newSize){
+ void *pNew = sqliteRealloc(*ppBuf, newSize);
+ if( pNew==0 ){
+ sqliteFree(*ppBuf);
+ }
+ *ppBuf = pNew;
+}
+
+/*
** Create a string from the 2nd and subsequent arguments (up to the
** first NULL argument), store the string in memory obtained from
** sqliteMalloc() and make the pointer indicated by the 1st argument