Check for zero-byte allocations in sqlite3MallocRaw. (CVS 2533)

FossilOrigin-Name: 78cb8a9a17a29bb8d9ffb6298b25cc43f9cbfed9
This commit is contained in:
drh 2005-06-29 17:24:23 +00:00
parent ba336867c4
commit 67ce73b466
3 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Make\ssqlite3Malloc\salways\sreturn\sNULL\swhen\sthe\snumber\sof\sbytes\sto\sallocate\nis\s0.\s(CVS\s2532)
D 2005-06-29T15:33:00
C Check\sfor\szero-byte\sallocations\sin\ssqlite3MallocRaw.\s(CVS\s2533)
D 2005-06-29T17:24:24
F Makefile.in 64a6635ef44a98325e0cffe8d67669920a3dad47
F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -75,7 +75,7 @@ F src/tokenize.c 57ec9926612fb9e325b57a141303573bc20c79bf
F src/trigger.c f51dec15921629591cb98bf2e350018e268b109a
F src/update.c e96c7b342cd8903c672162f4cf84d2c737943347
F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c
F src/util.c 1e7fe04761b07aaeba006b79e88ce7674e316560
F src/util.c 1acbe299cbe51f45176ac1e48ded9bea206c3c23
F src/vacuum.c 829d9e1a6d7c094b80e0899686670932eafd768c
F src/vdbe.c 56e892e351eb3ed634c3c239e4ad5c03aecfc2bf
F src/vdbe.h 75e466d84d362b0c4498978a9d6b1e6bd32ecf3b
@ -283,7 +283,7 @@ F www/tclsqlite.tcl 425be741b8ae664f55cb1ef2371aab0a75109cf9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 528299b8316726dbcc5548e9aa0648c8b1bd055b
P d5392866bfd6e06c6d072f649356050b82273a23
R e7d4efbbe31d42bc6c03cfcac1241e07
P 657d74ebc1d91c99e8ac6cd68fdac3864ebd8d71
R f78bcb412c87ec4317d54ace88119e56
U drh
Z 56338a496c34281f80fa8ed727cf9c75
Z 52ca4245d096125f04b549d01d9400ec

View File

@ -1 +1 @@
657d74ebc1d91c99e8ac6cd68fdac3864ebd8d71
78cb8a9a17a29bb8d9ffb6298b25cc43f9cbfed9

View File

@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.139 2005/06/29 15:33:00 drh Exp $
** $Id: util.c,v 1.140 2005/06/29 17:24:24 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@ -283,6 +283,7 @@ void *sqlite3Malloc(int n){
*/
void *sqlite3MallocRaw(int n){
void *p;
if( n==0 ) return 0;
if( (p = malloc(n))==0 ){
if( n>0 ) sqlite3_malloc_failed++;
}