]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Ensure that address and bouncedata are freed in unsub_bouncers()
authorRichard Mortimer <none@none>
Tue, 25 Jan 2011 18:59:39 +0000 (18:59 +0000)
committerRichard Mortimer <none@none>
Tue, 25 Jan 2011 18:59:39 +0000 (18:59 +0000)
src/mlmmj-maintd.c

index 4fbc1e89b3ab4902762ec6063b7b98dd3c589017..a6a26b0883759c0be63f3fcb804b7020feb51444 100644 (file)
@@ -731,6 +731,7 @@ int unsub_bouncers(const char *listdir, const char *mlmmjunsub)
                a = strchr(firstbounce, ':');
                if(a == NULL) {
                        myfree(firstbounce);
+                       myfree(bouncedata);
                        continue;
                }
 
@@ -738,14 +739,17 @@ int unsub_bouncers(const char *listdir, const char *mlmmjunsub)
                bouncetime = (time_t)strtol(a, NULL, 10);
                myfree(firstbounce);
                t = time(NULL);
-               if(t - bouncetime < bouncelife + WAITPROBE)
+               if(t - bouncetime < bouncelife + WAITPROBE) {
+                       myfree(bouncedata);
                        continue; /* ok, don't unsub this one */
+               }
                
                /* Ok, go ahead and unsubscribe the address */
                address = mystrdup(dp->d_name);
                a = strchr(address, '=');
                if(a == NULL) { /* skip malformed */
                        myfree(address);
+                       myfree(bouncedata);
                        continue;
                }
                *a = '@';
@@ -754,6 +758,8 @@ int unsub_bouncers(const char *listdir, const char *mlmmjunsub)
                
                if(childpid < 0) {
                        log_error(LOG_ARGS, "Could not fork");
+                       myfree(address);
+                       myfree(bouncedata);
                        continue;
                }