gfapi: Add NULL check for volname in glfs_new()

BUG: 1199388
Change-Id: I66cb65355504eb47e4392576029a9a5422996a1b
Signed-off-by: Prashanth Pai <ppai@redhat.com>
Reviewed-on: http://review.gluster.org/9735
Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Prashanth Pai 2015-02-24 16:48:20 +05:30 committed by Niels de Vos
parent a25cdf135f
commit 9b3c799fa3

View File

@ -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);