]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
src/rrd_update.c: fix Coverity CID#26532 Resource leak
authorMarek Schimara <Marek.Schimara@bull.net>
Thu, 16 Jun 2016 09:31:41 +0000 (11:31 +0200)
committerMarek Schimara <Marek.Schimara@bull.net>
Thu, 23 Jun 2016 14:32:33 +0000 (16:32 +0200)
        CWE-404 / https://cwe.mitre.org/data/definitions/404.html

src/rrd_update.c

index 0ccd2b8127c853bb7e43a8d6e24276d3c92bb4d7..0fd85273f78117dee5701c337dc58236764bb97a 100644 (file)
@@ -692,6 +692,7 @@ int rrd_update(
     while ((opt = optparse_long(&options,longopts,NULL)) != -1) {
         switch (opt) {
         case 't':
+            if (tmplt) free(tmplt);
             tmplt = strdup(options.optarg);
             break;