summaryrefslogtreecommitdiffstats
path: root/api/src/glfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/glfs.c')
-rw-r--r--api/src/glfs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c
index 7d493720121..df8adb6faf5 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -554,6 +554,11 @@ pub_glfs_new (const char *volname)
int ret = -1;
glusterfs_ctx_t *ctx = NULL;
+ if (!volname) {
+ errno = EINVAL;
+ return NULL;
+ }
+
ctx = glusterfs_ctx_new ();
if (!ctx) {
return NULL;
@@ -894,6 +899,11 @@ pub_glfs_fini (struct glfs *fs)
int fs_init = 0;
int err = -1;
+ if (!fs) {
+ errno = EINVAL;
+ return 0;
+ }
+
ctx = fs->ctx;
if (ctx->mgmt) {
rpc_clnt_disable (ctx->mgmt);