1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Avoid allocating excess memory to the KeyInfo objects.

FossilOrigin-Name: df7859435161f3ecf36635ce574bf73573516a1f2c6e75be320619364e7067d1
This commit is contained in:
drh
2017-05-31 13:45:59 +00:00
parent d5bdd5effb
commit d4ab003d4e
3 changed files with 8 additions and 8 deletions

View File

@@ -1031,7 +1031,7 @@ static void selectInnerLoop(
** X extra columns.
*/
KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){
int nExtra = (N+X)*(sizeof(CollSeq*)+1);
int nExtra = (N+X)*(sizeof(CollSeq*)+1) - sizeof(CollSeq*);
KeyInfo *p = sqlite3DbMallocRawNN(db, sizeof(KeyInfo) + nExtra);
if( p ){
p->aSortOrder = (u8*)&p->aColl[N+X];