From 18c10bae6b06f4aac50e8775a8934e58be65daaa Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 7 Oct 2008 15:37:34 +0000 Subject: [PATCH] aniel Pocock reported that the argument may be NULL in low-diskspace situations, so check for that here to prevent a segmentation fault. -- Florian Forster git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1584 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_open.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c index 27965062..f262413b 100644 --- a/program/src/rrd_open.c +++ b/program/src/rrd_open.c @@ -364,6 +364,13 @@ void rrd_dontneed( unsigned long i; ssize_t _page_size = sysconf(_SC_PAGESIZE); + if (rrd_file == NULL) { +#if defined DEBUG && DEBUG + fprintf (stderr, "rrd_dontneed: Argument 'rrd_file' is NULL.\n"); +#endif + return; + } + #if defined DEBUG && DEBUG > 1 mincore_print(rrd_file, "before"); #endif -- 2.30.2