From 9bb55770097e7c438f8bcf92ee5c6bb4259cf812 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Fri, 5 Nov 2010 10:25:14 +0100 Subject: [PATCH] Try to fix #1660 about segfault during pruning --- bacula/src/dird/ua_prune.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5