]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Fix leak in error path reported by Coverity.
authorOliver Kurth <okurth@vmware.com>
Mon, 17 Jun 2019 18:41:36 +0000 (11:41 -0700)
committerOliver Kurth <okurth@vmware.com>
Mon, 17 Jun 2019 18:41:36 +0000 (11:41 -0700)
open-vm-tools/vgauth/serviceImpl/proto.c

index ab36dca4cfb0957268a66ce02c450ed9e14e3540..f097fb65047ae8032bcb0dfbc6b59838b6a22cd3 100644 (file)
@@ -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__);