diff options
author | stephan <stephan@noemail.net> | 2024-11-04 13:57:20 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2024-11-04 13:57:20 +0000 |
commit | 88ef6be57d8e306fcf927d97a7147688ae7df4f6 (patch) | |
tree | 69a3f418dcae65a77bc4787775ab3fbd369424a1 /ext/misc/sqlite3_stdio.c | |
parent | 2fd38836dcb57abc6b6925b180c5b6fb737f7b2a (diff) | |
download | sqlite-88ef6be57d8e306fcf927d97a7147688ae7df4f6.tar.gz sqlite-88ef6be57d8e306fcf927d97a7147688ae7df4f6.zip |
Fix two mismatched uses of malloc() and sqlite3_free() in sqlite3_stdio.c, as reported in [forum:7dd7c70038 | forum post 7dd7c70038].
FossilOrigin-Name: af0a345b3b287f82b54249cfa574ef3ce52305a6452058aac98cd473c361919e
Diffstat (limited to 'ext/misc/sqlite3_stdio.c')
-rw-r--r-- | ext/misc/sqlite3_stdio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/misc/sqlite3_stdio.c b/ext/misc/sqlite3_stdio.c index 5bb26084c..ba37e4be3 100644 --- a/ext/misc/sqlite3_stdio.c +++ b/ext/misc/sqlite3_stdio.c @@ -146,7 +146,7 @@ char *sqlite3_fgets(char *buf, int sz, FILE *in){ ** that into UTF-8. Otherwise, non-ASCII characters all get translated ** into '?'. */ - wchar_t *b1 = malloc( sz*sizeof(wchar_t) ); + wchar_t *b1 = sqlite3_malloc( sz*sizeof(wchar_t) ); if( b1==0 ) return 0; _setmode(_fileno(in), IsConsole(in) ? _O_WTEXT : _O_U8TEXT); if( fgetws(b1, sz/4, in)==0 ){ @@ -212,7 +212,7 @@ int sqlite3_fputs(const char *z, FILE *out){ ** use O_U8TEXT for everything in text mode. */ int sz = (int)strlen(z); - wchar_t *b1 = malloc( (sz+1)*sizeof(wchar_t) ); + wchar_t *b1 = sqlite3_malloc( (sz+1)*sizeof(wchar_t) ); if( b1==0 ) return 0; sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz); b1[sz] = 0; |