summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org.ua>2013-02-04 09:20:58 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2013-02-04 09:20:58 (GMT)
commit1eeab02e9de4d54178279b347296e98fd97e2a00 (patch) (side-by-side diff)
treefcda1e3aa8e917aadca130a95a7c1c5f32cd8124 /src
parent66775034166ac35bda383ef41213c95021b37b64 (diff)
downloadwydawca-1eeab02e9de4d54178279b347296e98fd97e2a00.tar.gz
wydawca-1eeab02e9de4d54178279b347296e98fd97e2a00.tar.bz2
Avoid reusing already freed data.
* src/job.c (procspool): Take a pointer to the triplet pointer as a closure data. Return immediately if it is NULL. (wydawca_scanner): Pass a pointer in the second argument in call to for_each_spool.
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/job.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/job.c b/src/job.c
index b49efe3..5dd69c7 100644
--- a/src/job.c
+++ b/src/job.c
@@ -112,9 +112,13 @@ job_active_count()
static int
procspool(struct spool *spool, void *data)
{
+ struct file_triplet *trp = *(struct file_triplet **)data;
+
+ if (!trp)
+ return 0;
timer_start("spool");
timer_start(spool->tag);
- spool_commit_triplets(spool, (struct file_triplet *)data);
+ spool_commit_triplets(spool, trp);
timer_stop(spool->tag);
timer_stop("spool");
return 0;
@@ -128,7 +132,7 @@ wydawca_scanner(struct job *job)
timer_start("wydawca");
spool_create_timers();
if (job->spool == &inotify_spool)
- rc = for_each_spool(procspool, job->triplet_list);
+ rc = for_each_spool(procspool, &job->triplet_list);
else if (job->spool == &fake_spool)
rc = scan_all_spools(1, &job->uid);
else {
@@ -394,4 +398,3 @@ job_init()
signal(SIGCHLD, queue_signal);
signal(SIGALRM, queue_signal);
}
-

Return to:

Send suggestions and report system problems to the System administrator.