diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2005-09-26 19:33:26 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2005-09-26 19:33:26 +0000 |
commit | 846b0826ab7a42791b12cc79bf28bb6045336a11 (patch) | |
tree | 9a3e8c1b7be24c636b9cec28d4f565bedf2a02fd /ext/pdo_sqlite/sqlite/src/util.c | |
parent | 15c9f414a6d3ffb65c93f0377d2ecaf6a2dac7d0 (diff) | |
download | php-git-846b0826ab7a42791b12cc79bf28bb6045336a11.tar.gz |
MFH: upgraded 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.c | 13 |
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 |