Fossil

Check-in [6b382b0818]
Login

Check-in [6b382b0818]

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

Overview
Comment:Change fossil_malloc() so that it does not report "out of memory" when allocating zero bytes.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6b382b0818157da6a4e35ca7790a079891004a0b
User & Date: drh 2011-05-12 12:02:02.599
References
2011-05-16
08:34 Fixed ticket [da3e0fb4b9]: "out of memory" error via apache cgi-bin. plus 2 other changes ... (artifact: a718a55e53 user: anonymous)
Context
2011-05-12
14:17
Back out the previous change, which was bogus. Remove traces of the FOSSIL_I18N compile-time option which is not actually used anywhere in the code anymore. ... (check-in: 0613db18be user: drh tags: trunk)
14:04
Initialize the output buffer for blob_compress prior to invoking zlib in order to avoid valgrind warnings about reading uninitialized memory. ... (check-in: c9bb729d5d user: drh tags: trunk)
12:14
Pull the latest changes from trunk into windows-i18n. ... (check-in: f25b6c00c8 user: drh tags: windows-i18n)
12:02
Change fossil_malloc() so that it does not report "out of memory" when allocating zero bytes. ... (check-in: 6b382b0818 user: drh tags: trunk)
01:08
Performance improvement by caching prepared statements when computing ancestors and descendents of a check-in. ... (check-in: dcc68b46b2 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
  }
}

/*
** Malloc and free routines that cannot fail
*/
void *fossil_malloc(size_t n){
  void *p = malloc(n);
  if( p==0 ) fossil_panic("out of memory");
  return p;
}
void fossil_free(void *p){
  free(p);
}
void *fossil_realloc(void *p, size_t n){







|







401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
  }
}

/*
** Malloc and free routines that cannot fail
*/
void *fossil_malloc(size_t n){
  void *p = malloc(n==0 ? 1 : n);
  if( p==0 ) fossil_panic("out of memory");
  return p;
}
void fossil_free(void *p){
  free(p);
}
void *fossil_realloc(void *p, size_t n){