Skip to content

Commit f900fd6

Browse files
author
Scott Miller
committed
ompi/oshmem: fix shmem_free to perform no-op on null ptr
Signed-off-by: Scott Miller <[email protected]> (cherry picked from commit a8766ad)
1 parent a408c59 commit f900fd6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

oshmem/shmem/c/shmem_free.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* Copyright (c) 2013-2015 Mellanox Technologies, Inc.
33
* All rights reserved.
4+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
45
* $COPYRIGHT$
56
*
67
* Additional copyrights may follow
@@ -41,7 +42,12 @@ static inline void _shfree(void* ptr)
4142
{
4243
int rc;
4344

44-
RUNTIME_CHECK_INIT(); RUNTIME_CHECK_ADDR(ptr);
45+
RUNTIME_CHECK_INIT();
46+
if (NULL == ptr) {
47+
return;
48+
}
49+
50+
RUNTIME_CHECK_ADDR(ptr);
4551

4652
#if OSHMEM_SPEC_COMPAT == 1
4753
shmem_barrier_all();

0 commit comments

Comments
 (0)