/ Check-in [12517d1b15]
Login

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

Overview
Comment:Fix a potential memory leak in RBU if the rbu_fossil_delta() SQL function is misused. Misuse never happens in a working RBU system, so this is not a particularly important fix.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 12517d1b15da46bc90bd95bb9c161d7f2ecdd7f28b1b3a5ed4397939ef986061
User & Date: drh 2019-02-19 17:45:31
Context
2019-02-19
18:39
Add the fossildelta.c extension in ext/misc with implementations of the Fossil delta functions. check-in: b80cafa6f8 user: drh tags: trunk
17:45
Fix a potential memory leak in RBU if the rbu_fossil_delta() SQL function is misused. Misuse never happens in a working RBU system, so this is not a particularly important fix. check-in: 12517d1b15 user: drh tags: trunk
16:42
Fix an assert() that might not be true if the database file is corrupt. check-in: f2d400db4d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rbu/sqlite3rbu.c.

   680    680   
   681    681     aOut = sqlite3_malloc(nOut+1);
   682    682     if( aOut==0 ){
   683    683       sqlite3_result_error_nomem(context);
   684    684     }else{
   685    685       nOut2 = rbuDeltaApply(aOrig, nOrig, aDelta, nDelta, aOut);
   686    686       if( nOut2!=nOut ){
          687  +      sqlite3_free(aOut);
   687    688         sqlite3_result_error(context, "corrupt fossil delta", -1);
   688    689       }else{
   689    690         sqlite3_result_blob(context, aOut, nOut, sqlite3_free);
   690    691       }
   691    692     }
   692    693   }
   693    694