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>
This commit is contained in:
parent
8a21f10ad3
commit
8814fdafab
@ -68,6 +68,10 @@ glusterfs_ctx_defaults_init (glusterfs_ctx_t *ctx)
|
|||||||
|
|
||||||
xlator_mem_acct_init (THIS, glfs_mt_end + 1);
|
xlator_mem_acct_init (THIS, glfs_mt_end + 1);
|
||||||
|
|
||||||
|
if (!ctx) {
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
ctx->process_uuid = generate_glusterfs_ctx_id ();
|
ctx->process_uuid = generate_glusterfs_ctx_id ();
|
||||||
if (!ctx->process_uuid) {
|
if (!ctx->process_uuid) {
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user