summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/client_t.c
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2014-12-10 11:10:52 +0100
committerNiels de Vos <ndevos@redhat.com>2014-12-12 01:19:05 -0800
commit9ca800392106201c555ff8d5e2bf7a77aa52234d (patch)
treee82325501741c855067ffd9e4ae41572d2f30e24 /libglusterfs/src/client_t.c
parente679d6417d39a696126e3f7ede1f2f38afc6e44c (diff)
client_t: fix for potential NULL pointer dereference
In case an error occurs, 'client' is free'd. The log message just before exiting the function should therefore not use the structure anymore. BUG: 789278 Change-Id: I0848328b29585057cd037a5972c4e5f06a7f978b CID: 1226165 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9262 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'libglusterfs/src/client_t.c')
-rw-r--r--libglusterfs/src/client_t.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libglusterfs/src/client_t.c b/libglusterfs/src/client_t.c
index ada85b484bb..5b0fd87a9c1 100644
--- a/libglusterfs/src/client_t.c
+++ b/libglusterfs/src/client_t.c
@@ -291,9 +291,10 @@ gf_client_get (xlator_t *this, struct rpcsvc_auth_data *cred, char *client_uid)
unlock:
UNLOCK (&clienttable->lock);
- gf_log_callingfn ("client_t", GF_LOG_DEBUG, "%s: bind_ref: %d, ref: %d",
- client->client_uid, client->ref.bind,
- client->ref.count);
+ if (client)
+ gf_log_callingfn ("client_t", GF_LOG_DEBUG, "%s: bind_ref: %d, "
+ "ref: %d", client->client_uid,
+ client->ref.bind, client->ref.count);
return client;
}