1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

sqlite3_stdio.c now uses sqlite3_malloc()/sqlite3_free() instead of malloc()/free(). Reported in [forum:6b6cb3ddc8a89b55|forum post 6b6cb3dd].

FossilOrigin-Name: 1982471da14648594d616233be947e343611e7e3d6be7ae6b20d739e544675ea
This commit is contained in:
stephan
2024-11-05 02:14:23 +00:00
parent bf19927688
commit 1934310ebd
3 changed files with 16 additions and 16 deletions

View File

@ -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;
}