SQLite

Check-in [507027b70f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a memory leak in fts3 that can occur in an OOM condition.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 507027b70f71689f77dee3e849ebc66a1c4c3166
User & Date: dan 2010-12-04 18:20:19.000
Context
2010-12-04
19:35
Version 3.7.4 release candidate 2. (check-in: 40756fe1f1 user: drh tags: trunk)
18:20
Fix a memory leak in fts3 that can occur in an OOM condition. (check-in: 507027b70f user: dan tags: trunk)
2010-12-03
18:57
Remove an over-zealous call to memAboutToChange() from OP_MustBeInt. OP_MustBeInt will never invalidate the Mem.z pointer so the memAboutToChange() call is not necessary. (check-in: 841cf7a7db user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/fts3/fts3.c.
2679
2680
2681
2682
2683
2684
2685

2686
2687




2688
2689
2690
2691
2692
2693
2694
              );
              sqlite3_free(aNew);
            }
          }
        }
      }


      *paOut = aRet;
      *pnOut = nRet;




      sqlite3_free(aExpr);
      fts3ExprFreeSegReaders(pExpr);

    }else{
      char *aLeft;
      char *aRight;
      int nLeft;







>
|
|
>
>
>
>







2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
              );
              sqlite3_free(aNew);
            }
          }
        }
      }

      if( rc==SQLITE_OK ){
        *paOut = aRet;
        *pnOut = nRet;
      }else{
        assert( *paOut==0 );
        sqlite3_free(aRet);
      }
      sqlite3_free(aExpr);
      fts3ExprFreeSegReaders(pExpr);

    }else{
      char *aLeft;
      char *aRight;
      int nLeft;
2753
2754
2755
2756
2757
2758
2759

2760
2761
2762
2763
2764
2765
2766
          }
        }
      }
      sqlite3_free(aRight);
    }
  }


  return rc;
}

/*
** This function is called from within xNext() for each row visited by
** an FTS3 query. If evaluating the FTS3 query expression within xFilter()
** was able to determine the exact set of matching rows, this function sets







>







2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
          }
        }
      }
      sqlite3_free(aRight);
    }
  }

  assert( rc==SQLITE_OK || *paOut==0 );
  return rc;
}

/*
** This function is called from within xNext() for each row visited by
** an FTS3 query. If evaluating the FTS3 query expression within xFilter()
** was able to determine the exact set of matching rows, this function sets