Skip to content
This repository
Browse code

Added check whether the pointer passed to ::operator delete is NULL.

git-svn-id: http://svn.daimi.au.dk/svn/tpie/trunk@232 669acd26-ddd2-4139-9e68-486997aa639d
  • Loading branch information...
commit 6f962b006f655d75942af8bac224e3b7db97ccee 1 parent 80aba2a
Jan Vahrenhold authored

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. +2 1  tpie/lib/src/mm_base.cpp
3  tpie/lib/src/mm_base.cpp
@@ -7,7 +7,7 @@
7 7
8 8
9 9
10   -static char mm_base_id[] = "$Id: mm_base.cpp,v 1.2 1994-12-16 21:14:29 darrenv Exp $";
  10 +static char mm_base_id[] = "$Id: mm_base.cpp,v 1.3 1997-10-28 20:04:44 jan Exp $";
11 11
12 12
13 13
@@ -52,6 +52,7 @@ void * operator new (size_t sz) {
52 52 }
53 53
54 54 void operator delete (void *ptr) {
  55 + if (!ptr) return;
55 56 if (register_new) {
56 57 MM_manager.register_deallocation(*((size_t *)
57 58 (((char *)ptr) - SIZE_SPACE)) +

0 comments on commit 6f962b0

Please sign in to comment.
Something went wrong with that request. Please try again.