Fossil

Check-in [868404c0]
Login

Check-in [868404c0]

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

Overview
Comment:Make sure memory returned from db_get() has been properly reallocated if it uses the default value.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 868404c0a3adc017034c2b065fcede74710dc8d7
User & Date: drh 2015-09-15 18:58:57
Context
2015-09-16
08:57
Remove unnecessary end-of-line spacing in various places ... (check-in: 4db19dcc user: jan.nijtmans tags: trunk)
2015-09-15
18:58
Make sure memory returned from db_get() has been properly reallocated if it uses the default value. ... (check-in: 868404c0 user: drh tags: trunk)
2015-09-12
19:18
Fix the "fossil diff --undo" option so that it works even when called from a subdirectory of the project. ... (check-in: f6c13632 user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/db.c.

2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
    ** checked out file */
    z = db_get_versioned(zName, z);
  }
  if( z==0 ){
    if( zDefault==0 && pSetting && pSetting->def[0] ){
      z = fossil_strdup(pSetting->def);
    }else{
      z = zDefault;
    }
  }
  return z;
}
char *db_get_mtime(const char *zName, char *zFormat, char *zDefault){
  char *z = 0;
  if( g.repositoryOpen ){







|







2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
    ** checked out file */
    z = db_get_versioned(zName, z);
  }
  if( z==0 ){
    if( zDefault==0 && pSetting && pSetting->def[0] ){
      z = fossil_strdup(pSetting->def);
    }else{
      z = fossil_strdup(zDefault);
    }
  }
  return z;
}
char *db_get_mtime(const char *zName, char *zFormat, char *zDefault){
  char *z = 0;
  if( g.repositoryOpen ){