From b1e29fa3f2f68ba67df561662718da8927c75945 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 24 Mar 2022 13:02:51 +0100 Subject: [PATCH] Fix small memory leak after restore error --- bacula/src/dird/ua_restore.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 9caab2ee0..382b2d338 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -140,7 +140,7 @@ int restore_cmd(UAContext *ua, const char *cmd) strip_prefix = add_prefix = add_suffix = regexp = NULL; new_rx(&rx); /* Initialize RESTORE_CTX */ - + if (!open_new_client_db(ua)) { goto bail_out; } @@ -406,6 +406,9 @@ int restore_cmd(UAContext *ua, const char *cmd) rx.component_fname = NULL; jcr->component_fd = rx.component_fd; rx.component_fd = NULL; + if (jcr->bsr_list) { + free_bsr(jcr->bsr_list); + } /* The Client might request the file list */ jcr->bsr_list = rx.bsr_list; rx.bsr_list = NULL; -- 2.47.3