diff options
Diffstat (limited to 'intern/guardedalloc')
-rw-r--r-- | intern/guardedalloc/intern/mallocn.c | 1 | ||||
-rw-r--r-- | intern/guardedalloc/intern/mallocn_guarded_impl.c | 1 | ||||
-rw-r--r-- | intern/guardedalloc/intern/mallocn_lockfree_impl.c | 8 |
3 files changed, 10 insertions, 0 deletions
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c index a379837c552..1fd85a0c9f5 100644 --- a/intern/guardedalloc/intern/mallocn.c +++ b/intern/guardedalloc/intern/mallocn.c @@ -17,6 +17,7 @@ * * Contributor(s): Brecht Van Lommel * Campbell Barton + * Sergey Sharybin * * ***** END GPL LICENSE BLOCK ***** */ diff --git a/intern/guardedalloc/intern/mallocn_guarded_impl.c b/intern/guardedalloc/intern/mallocn_guarded_impl.c index ecc54882447..9a503422282 100644 --- a/intern/guardedalloc/intern/mallocn_guarded_impl.c +++ b/intern/guardedalloc/intern/mallocn_guarded_impl.c @@ -22,6 +22,7 @@ * * Contributor(s): Brecht Van Lommel * Campbell Barton + * Sergey Sharybin * * ***** END GPL LICENSE BLOCK ***** */ diff --git a/intern/guardedalloc/intern/mallocn_lockfree_impl.c b/intern/guardedalloc/intern/mallocn_lockfree_impl.c index eaa60202f3c..b5f3d1b15dc 100644 --- a/intern/guardedalloc/intern/mallocn_lockfree_impl.c +++ b/intern/guardedalloc/intern/mallocn_lockfree_impl.c @@ -134,6 +134,14 @@ void MEM_lockfree_freeN(void *vmemh) MemHead *memh = MEMHEAD_FROM_PTR(vmemh); size_t len = MEM_lockfree_allocN_len(vmemh); + if (vmemh == NULL) { + print_error("Attempt to free NULL pointer\n"); +#ifdef WITH_ASSERT_ABORT + abort(); +#endif + return; + } + atomic_sub_u(&totblock, 1); atomic_sub_z(&mem_in_use, len); |