8 Commits

Author SHA1 Message Date
Rene Kita
07bccf3e36 Exit with error if a new buffer can't be allocated
When building with gcc and -Wnull-dereference, -O3 and -flto we get a
lot of warnings about potential null dereferences. Exiting instead of
returning NULL solves all of it.

If we cannot alloc memory, there is not much to do - exiting is the
easiest option.
2023-01-05 20:03:14 +09:00
Rene Kita
9f5c311e45 Do not call fclose() on a NULL pointer
The if clause is true if cache is NULL. man 3 fclose says:

  The  behaviour  of  fclose() is undefined if the stream parameter is an
  illegal pointer, or is a descriptor already passed to a previous  invo‐
  cation of fclose().

Check if cache is NULL before calling fclose().
2022-04-19 10:08:54 +02:00
Rene Kita
c5c63a1a3d Fix a potential buffer overflow
When compiling with -Wformat-overflow=2 GCC reports:
  note: 'sprintf' output between 16 and 35 bytes into a destination of size 32
2022-02-20 11:14:54 +01:00
Ben Wong
94ab9857e9 Fix that the MarkAllPages option works as originally intended
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911929
2018-10-26 21:34:19 +09:00
David Crosby
66036b0db6 Check for presence of prevl before using 2015-08-11 21:59:28 +09:00
David Crosby
2582ffa397 Fix resource leak in readBufferCache 2015-08-11 21:59:27 +09:00
Tatsuya Kinoshita
5397d09e58 Adding upstream version 0.5.3 2011-05-04 16:41:45 +09:00
Tatsuya Kinoshita
72f72d64a4 Adding upstream version 0.5.1 2011-05-04 16:05:14 +09:00