From 9ca800392106201c555ff8d5e2bf7a77aa52234d Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Wed, 10 Dec 2014 11:10:52 +0100 Subject: 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 Reviewed-on: http://review.gluster.org/9262 Tested-by: Gluster Build System Reviewed-by: Kaleb KEITHLEY --- libglusterfs/src/client_t.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libglusterfs/src') 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; } -- cgit