From: Eric Bollengier Date: Fri, 5 Nov 2010 09:25:14 +0000 (+0100) Subject: Try to fix #1660 about segfault during pruning X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9bb55770097e7c438f8bcf92ee5c6bb4259cf812;p=bacula%2Fbacula Try to fix #1660 about segfault during pruning --- diff --git a/bacula/src/dird/ua_prune.c b/bacula/src/dird/ua_prune.c index edef66ded0..fb2efb09a4 100644 --- a/bacula/src/dird/ua_prune.c +++ b/bacula/src/dird/ua_prune.c @@ -409,6 +409,7 @@ int prune_jobs(UAContext *ua, CLIENT *client, POOL *pool, int JobType) JOB_DBR jr; db_lock(ua->db); + memset(&del, 0, sizeof(del)); memset(&cr, 0, sizeof(cr)); bstrncpy(cr.Name, client->name(), sizeof(cr.Name)); @@ -438,7 +439,6 @@ int prune_jobs(UAContext *ua, CLIENT *client, POOL *pool, int JobType) edit_int64(now - period, ed1); /* Jobs older than ed1 are good candidates */ edit_int64(cr.ClientId, ed2); - memset(&del, 0, sizeof(del)); del.max_ids = 100; del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids); del.PurgedFiles = (char *)malloc(del.max_ids);