summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Gohad <tusharsg@gmail.com>2016-03-10 01:00:40 +0000
committerTushar Gohad <tusharsg@gmail.com>2016-03-10 01:00:40 +0000
commitfd88e703372eed2ecda8f10fe539ee28b2794e0f (patch)
treec5ff0b56b02caa7db002ab1e7309cacbbf77e96f
parent24763e7002fc4d86464ef7c947d8c25fabe671ec (diff)
downloadliberasurecode-fd88e703372eed2ecda8f10fe539ee28b2794e0f.tar.gz
Add NULL instance check to backend_open()
-rw-r--r--src/erasurecode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/erasurecode.c b/src/erasurecode.c
index 6528eec..67ca393 100644
--- a/src/erasurecode.c
+++ b/src/erasurecode.c
@@ -170,6 +170,8 @@ static void print_dlerror(const char *caller)
/* Generic dlopen/dlclose routines */
void* liberasurecode_backend_open(ec_backend_t instance)
{
+ if (NULL == instance)
+ return NULL;
/* Use RTLD_LOCAL to avoid symbol collisions */
return dlopen(instance->common.soname, RTLD_LAZY | RTLD_LOCAL);
}