Sayyiduna Anas bin Malik (may Allah be pleased with him) said: Some orphan children were under the care of Sayyiduna Abu Talhah (may Allah be pleased with him). Sayyiduna Abu Talhah (may Allah be pleased with him) bought wine for them, then the verse regarding the prohibition of wine was revealed. He went to the Messenger of Allah (peace and blessings be upon him) and mentioned this, and said: Should I turn this wine into vinegar? The Messenger of Allah (peace and blessings be upon him) said: "No." So he poured it away.
Hadith Referenceسنن دارمي / من كتاب الاشربة / 2152
Hadith Gradingتحقیق (حسین سلیم أسد الدارانی):إسناده حسن من أجل إسماعيل السدي، [مكتبه الشامله نمبر: 2161]
From this hadith, it is understood that just as wine (khamr) is forbidden, likewise its vinegar is also forbidden. For this reason, the Messenger of Allah (sallallahu alayhi wa sallam) prohibited making vinegar from it.