From: Oliver Kurth Date: Mon, 17 Jun 2019 18:41:36 +0000 (-0700) Subject: Fix leak in error path reported by Coverity. X-Git-Tag: stable-11.0.0~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cf4c83d4a0b580209184bb4d5ac6c26cd5734f4;p=thirdparty%2Fopen-vm-tools.git Fix leak in error path reported by Coverity. --- diff --git a/open-vm-tools/vgauth/serviceImpl/proto.c b/open-vm-tools/vgauth/serviceImpl/proto.c index ab36dca4c..f097fb650 100644 --- a/open-vm-tools/vgauth/serviceImpl/proto.c +++ b/open-vm-tools/vgauth/serviceImpl/proto.c @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2011-2016 VMware, Inc. All rights reserved. + * Copyright (C) 2011-2016,2019 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -1518,6 +1518,7 @@ ServiceProtoHandleSessionRequest(ServiceConnection *conn, atoi(VGAUTH_PROTOCOL_VERSION)); packet = Proto_MakeErrorReply(conn, req, err, "sessionRequest failed; version mismatch"); + goto send_err; } err = ServiceStartUserConnection(req->reqData.sessionReq.userName, @@ -1530,6 +1531,7 @@ ServiceProtoHandleSessionRequest(ServiceConnection *conn, pipeName); } +send_err: err = ServiceNetworkWriteData(conn, strlen(packet), packet); if (err != VGAUTH_E_OK) { Warning("%s: failed to send SessionReq reply\n", __FUNCTION__);