aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/sqlite3_stdio.c
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2024-11-05 02:14:23 +0000
committerstephan <stephan@noemail.net>2024-11-05 02:14:23 +0000
commit1934310ebd54e9f1d2b16fa7e5f14fafec6d8fba (patch)
tree081fe716a9128c9fee2e0b6ecc45308a7bd901b2 /ext/misc/sqlite3_stdio.c
parentbf19927688a29a88de58eaf2b0618cc1c374708c (diff)
downloadsqlite-1934310ebd54e9f1d2b16fa7e5f14fafec6d8fba.tar.gz
sqlite-1934310ebd54e9f1d2b16fa7e5f14fafec6d8fba.zip
sqlite3_stdio.c now uses sqlite3_malloc()/sqlite3_free() instead of malloc()/free(). Reported in [forum:6b6cb3ddc8a89b55|forum post 6b6cb3dd].
FossilOrigin-Name: 1982471da14648594d616233be947e343611e7e3d6be7ae6b20d739e544675ea
Diffstat (limited to 'ext/misc/sqlite3_stdio.c')
-rw-r--r--ext/misc/sqlite3_stdio.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/misc/sqlite3_stdio.c b/ext/misc/sqlite3_stdio.c
index ba37e4be3..729504629 100644
--- a/ext/misc/sqlite3_stdio.c
+++ b/ext/misc/sqlite3_stdio.c
@@ -96,8 +96,8 @@ FILE *sqlite3_fopen(const char *zFilename, const char *zMode){
sz1 = (int)strlen(zFilename);
sz2 = (int)strlen(zMode);
- b1 = malloc( (sz1+1)*sizeof(b1[0]) );
- b2 = malloc( (sz2+1)*sizeof(b1[0]) );
+ b1 = sqlite3_malloc( (sz1+1)*sizeof(b1[0]) );
+ b2 = sqlite3_malloc( (sz2+1)*sizeof(b1[0]) );
if( b1 && b2 ){
sz1 = MultiByteToWideChar(CP_UTF8, 0, zFilename, sz1, b1, sz1);
b1[sz1] = 0;
@@ -105,8 +105,8 @@ FILE *sqlite3_fopen(const char *zFilename, const char *zMode){
b2[sz2] = 0;
fp = _wfopen(b1, b2);
}
- free(b1);
- free(b2);
+ sqlite3_free(b1);
+ sqlite3_free(b2);
simBinaryOther = 0;
return fp;
}
@@ -122,8 +122,8 @@ FILE *sqlite3_popen(const char *zCommand, const char *zMode){
sz1 = (int)strlen(zCommand);
sz2 = (int)strlen(zMode);
- b1 = malloc( (sz1+1)*sizeof(b1[0]) );
- b2 = malloc( (sz2+1)*sizeof(b1[0]) );
+ b1 = sqlite3_malloc( (sz1+1)*sizeof(b1[0]) );
+ b2 = sqlite3_malloc( (sz2+1)*sizeof(b1[0]) );
if( b1 && b2 ){
sz1 = MultiByteToWideChar(CP_UTF8, 0, zCommand, sz1, b1, sz1);
b1[sz1] = 0;
@@ -131,8 +131,8 @@ FILE *sqlite3_popen(const char *zCommand, const char *zMode){
b2[sz2] = 0;
fp = _wpopen(b1, b2);
}
- free(b1);
- free(b2);
+ sqlite3_free(b1);
+ sqlite3_free(b2);
return fp;
}