#fixed code
                             public void setClientID(ByteString id) throws IOException {
	    if(id.size() > Constants.RIAK_CLIENT_ID_LENGTH) {
	        id = ByteString.copyFrom(id.toByteArray(), 0, Constants.RIAK_CLIENT_ID_LENGTH);
	    }

		this.clientId = id.toByteArray();
	}
#vulnerable code 
                             public void setClientID(ByteString id) throws IOException {
	    if(id.size() > Constants.RIAK_CLIENT_ID_LENGTH) {
	        id = ByteString.copyFrom(id.toByteArray(), 0, Constants.RIAK_CLIENT_ID_LENGTH);
	    }
		RpbSetClientIdReq req = RPB.RpbSetClientIdReq.newBuilder().setClientId(
				id).build();
		RiakConnection c = getConnection(false);
		try {
			c.send(MSG_SetClientIdReq, req);
			c.receive_code(MSG_SetClientIdResp);
		} finally {
			release(c);
		}

		this.clientID = id;
	} 
                            #location 12 
                            #vulnerability type RESOURCE_LEAK