From: Mikko Rasa Date: Sun, 22 Apr 2018 08:37:54 +0000 (+0300) Subject: Avoid memory leak if an invalid uniform name is given X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=deecc415cc7ecf24250f2c8c5d6e727fba3eb348;p=libs%2Fgl.git Avoid memory leak if an invalid uniform name is given --- 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())