free up old config value when a duplicate is found.
authorJim Morris <morris@wolfman.com>
Wed, 1 Mar 2017 05:49:01 +0000 (21:49 -0800)
committerJim Morris <morris@wolfman.com>
Wed, 1 Mar 2017 05:49:01 +0000 (21:49 -0800)
src/libs/ConfigCache.cpp

index 760c8cd..20f6b47 100644 (file)
@@ -34,6 +34,7 @@ void ConfigCache::replace_or_push_back(ConfigValue *new_value)
         // If this configvalue matches the checksum
         if(memcmp(new_value->check_sums, cv->check_sums, sizeof(cv->check_sums)) == 0) {
             // Replace with the provided value
+            delete cv; // free up old one
             cv =  new_value;
             printf("WARNING: duplicate config line replaced\n");
             return;