Exhibit 10.40
[NS Non-Employee Director Form]
CHANGE OF CONTROL WAIVER AGREEMENT
This Agreement (“Agreement”) is hereby entered into effective as of February 7, 2018 by and between ____________ (the “Director”), NuStar Energy L.P., a Delaware limited partnership (the “Partnership”), NuStar Services Company LLC and NuStar GP, LLC (“NuStar GP”) (collectively, the Partnership, NuStar GP and their respective affiliates referred to herein as “NuStar”).
RECITALS
WHEREAS, pursuant to the NuStar GP, LLC Fifth Amended and Restated 2000 Long-Term Incentive Plan (the “Partnership LTIP”), the Director was granted certain awards of phantom units representing common units of the Partnership (the “Partnership Phantom Units”)which are subject to certain vesting conditions and represented by the awards described in Exhibit A hereto (collectively, the “Awards”);
WHEREAS, under the terms of the Partnership LTIP and the Awards, in the event of a “Change of Control” (as defined in the Partnership LTIP), all outstanding Partnership Phantom Units granted under the Partnership LTIP generally become fully vested on the date thereof;
WHEREAS, contemporaneously herewith, the Partnership, Riverwalk Logistics, L.P., a Delaware limited partnership and the general partner of the Partnership (“Riverwalk”), NuStar GP, Marshall Merger Sub LLC, a Delaware limited liability company and wholly owned subsidiary of the Partnership (“Merger Sub”), NuStar GP Holdings, LLC, a Delaware limited liability company (“NSH”) and Riverwalk Holdings, LLC, a Delaware limited liability and a wholly owned subsidiary of NSH, are entering into an Agreement and Plan of Merger (the “Merger Agreement”) pursuant to which Merger Sub will merge with and into NSH, with NSH being the surviving entity, such that following the transactions contemplated by the Merger Agreement, the Partnership will be the sole member of such surviving entity and such surviving entity will be the sole member of NuStar GP;
WHEREAS, in connection with the transactions contemplated by the Merger Agreement (the “Merger”), the Partnership LTIP has been amended (the “Amendment”) in accordance with the terms thereof, to provide that the Merger is not a “Change of Control” (as defined in the Partnership LTIP);
WHEREAS, in connection with the Merger, a “Change of Control” (as defined in the Partnership LTIP prior to the Amendment) could or could be deemed to occur and the Director may be (or, in the case of the Partnership LTIP, would have been if the Amendment had not been adopted) entitled to the payments and benefits provided under the Partnership LTIP and the Awards upon and in connection with the consummation of the Merger, including but not limited to the immediate vesting of all of the outstanding Partnership Phantom Units held by the Director as of the date of such Merger (collectively, the “Change of Control Benefits”); and

WHEREAS, the parties did not intend for any Change of Control Benefits to be payable upon or in connection with a business combination like the Merger.
WAIVER AND CONSENT
NOW, THEREFORE, for good and valuable consideration, the receipt and sufficiency of which are hereby acknowledged, the parties agree as follows:
1. Notwithstanding the terms of the Partnership LTIP or the Awards, the parties agree that the Merger shall not constitute or be deemed to constitute a “Change of Control” (as defined in the Partnership LTIP) and the Amendment was validly adopted.
2. The Director agrees and acknowledges that the Director shall not receive any of the Change of Control Benefits that may otherwise have been payable to the Director upon or in connection with the consummation of the Merger. The Director irrevocably waives any and all Change of Control Benefits that may otherwise have been payable to the Director upon the consummation of the Merger and the Director’s right to receive any Change of Control Benefits in the future with respect to or arising out of the Merger.
3. Except as expressly provided herein, all other terms and conditions of the Partnership LTIP and the Awards shall remain in full force and effect; provided, however, that the Partnership LTIP and/or the Awards may be amended pursuant to their terms to reflect the terms of this Agreement and/or the occurrence of the Merger. For the avoidance of doubt, nothing in this Agreement shall affect the Director’s right to any payments or benefits provided under the terms of the Partnership LTIP or the Awards with respect to any transaction occurring after the Merger that constitutes or could be deemed to constitute a “Change of Control” as defined in the Partnership LTIP.
4. This Agreement shall be governed by and construed in accordance with the laws of the State of Delaware without reference to such state’s principles of conflicts of law. The Director hereby (i) irrevocably consents to the exclusive jurisdiction of any court located in the State of Delaware in connection with any matter based upon or arising out of this Agreement or the matters contemplated herein, (ii) agrees that process may be served upon the Director in any manner authorized by the laws of the Delaware, and (iii) irrevocably waives, and covenants not to assert or plead, any objection which the Director might otherwise have to such jurisdiction and such process.
5. Director acknowledges and agrees that this Agreement will be binding upon and inure to the benefit of (i) the heirs, executors and legal representatives of the undersigned Director upon the undersigned Director’s death and (ii) any successor of NuStar and its subsidiaries or affiliates. Any such successor will be deemed substituted for NuStar under the terms of this Agreement for purposes of enforcing the rights hereunder of NuStar.

6. In the event the Merger Agreement is terminated in accordance with its terms, this Agreement shall terminate concurrently therewith. In the event the Merger does not occur or fails to become effective, this Agreement shall be without force or effect.
7. The Director certifies, acknowledges and agrees that the Director has read and completely understands this Agreement and that the Director is signing freely and voluntarily, without duress, coercion or undue influence.
8. This Agreement may be executed in two or more counterparts, each of which shall be deemed an original and all of which together shall constitute one document.
[Signature Page Follows; Remainder of Page Intentionally Left Blank]

IN WITNESS WHEREOF, the parties have executed this Agreement effective as of the date first written above.
___________________________
Director
NuStar Energy L.P.
By: Riverwalk Logistics, L.P., its general partner
By: NuStar GP, LLC, its general partner
By:
Name:
Title:
NuStar GP, LLC
By:
Name:
Title:
NuStar Services Company LLC
By:
Name:
Title:

Exhibit A
[List of outstanding Awards granted to the Director]