]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Ensure that filename is always freed in clean_nolongerbouncing()
authorRichard Mortimer <none@none>
Tue, 25 Jan 2011 16:46:52 +0000 (16:46 +0000)
committerRichard Mortimer <none@none>
Tue, 25 Jan 2011 16:46:52 +0000 (16:46 +0000)
src/mlmmj-maintd.c

index b986fcf1d0cdeb2e99c4b284da172b55d65b92d8..f94f13b0f9f020631285a809d5453ea616cf6ba7 100644 (file)
@@ -532,11 +532,15 @@ int clean_nolongerbouncing(const char *listdir)
                        }
 
                        probefd = open(filename, O_RDONLY);
-                       if(probefd < 0)
+                       if(probefd < 0) {
+                               myfree(filename);
                                continue;
+                       }
                        probetimestr = mygetline(probefd);
-                       if(probetimestr == NULL)
+                       if(probetimestr == NULL) {
+                               myfree(filename);
                                continue;
+                       }
                        close(probefd);
                        chomp(probetimestr);
                        probetime = (time_t)strtol(probetimestr, NULL, 10);