summaryrefslogtreecommitdiff
path: root/tools.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2011-02-25 15:25:42 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2011-02-25 15:25:42 +0100
commitd1ab9dbc5f0c35aa10ee0c67b9dc2eb6fd31dd13 (patch)
tree01b6346cf321f0c2569b2c12f43d931e5f6281a7 /tools.h
parente145ee45e2c2a112629814bcbba6f0e759f5132a (diff)
downloadvdr-d1ab9dbc5f0c35aa10ee0c67b9dc2eb6fd31dd13.tar.gz
vdr-d1ab9dbc5f0c35aa10ee0c67b9dc2eb6fd31dd13.tar.bz2
Now checking the result of all realloc() calls
Diffstat (limited to 'tools.h')
-rw-r--r--tools.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools.h b/tools.h
index 7a05b433..f17c5642 100644
--- a/tools.h
+++ b/tools.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.h 2.6 2010/12/12 23:15:52 kls Exp $
+ * $Id: tools.h 2.7 2011/02/25 15:05:58 kls Exp $
*/
#ifndef __TOOLS_H
@@ -434,6 +434,10 @@ private:
{
if (++Index > allocated) {
data = (T *)realloc(data, Index * sizeof(T));
+ if (!data) {
+ esyslog("ERROR: out of memory - abort!");
+ abort();
+ }
for (int i = allocated; i < Index; i++)
data[i] = T(0);
allocated = Index;