diff options
author | Jose A. Rivera <jarrpa@redhat.com> | 2014-01-24 09:56:17 -0600 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-01-24 23:46:35 -0800 |
commit | 8814fdafab377139cdf3863096234f4d5b6e543e (patch) | |
tree | c9ae5232d5ed8477cd198e44174954ea5f8cc1e3 /api/src | |
parent | 8a21f10ad373dad117557555a7db43d489d05b28 (diff) | |
download | glusterfs-8814fdafab377139cdf3863096234f4d5b6e543e.tar.gz glusterfs-8814fdafab377139cdf3863096234f4d5b6e543e.tar.xz glusterfs-8814fdafab377139cdf3863096234f4d5b6e543e.zip |
libgfapi: Fix pointer dereference before NULL check
ctx is not checked for NULL before it is dereferenced, though the
check in "err" seems to suggest we should guard against it.
BUG: 789278
CID: 1124827
Change-Id: I6ed0b42992af5f370cce9aa2feb56811cdd54b42
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-on: http://review.gluster.org/6782
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'api/src')
-rw-r--r-- | api/src/glfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c index 1bae78d237..2b4312eac3 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -68,6 +68,10 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx) xlator_mem_acct_init (THIS, glfs_mt_end + 1); + if (!ctx) { + goto err; + } + ctx->process_uuid = generate_glusterfs_ctx_id (); if (!ctx->process_uuid) { goto err; |