]> git.tdb.fi Git - libs/gl.git/commitdiff
Avoid memory leak if an invalid uniform name is given
authorMikko Rasa <tdb@tdb.fi>
Sun, 22 Apr 2018 08:37:54 +0000 (11:37 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 22 Apr 2018 08:37:54 +0000 (11:37 +0300)
source/programdata.cpp

index 01927063377b693b72c9ede4cabdb050ecd91067..8a10f59c0c73beb5d5406816b0d63987fb087558 100644 (file)
@@ -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())