From deecc415cc7ecf24250f2c8c5d6e727fba3eb348 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 22 Apr 2018 11:37:54 +0300 Subject: [PATCH] Avoid memory leak if an invalid uniform name is given --- source/programdata.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/programdata.cpp b/source/programdata.cpp index 01927063..8a10f59c 100644 --- a/source/programdata.cpp +++ b/source/programdata.cpp @@ -65,7 +65,10 @@ ProgramData::~ProgramData() void ProgramData::uniform(const string &name, Uniform *uni) { if(name[name.size()-1]==']') + { + delete uni; throw invalid_argument("ProgramData::uniform"); + } SlotMap::iterator i = uniform_slots.find(name); if(i!=uniform_slots.end()) -- 2.45.2