From: Eric Bollengier Date: Thu, 24 Mar 2022 12:02:51 +0000 (+0100) Subject: Fix small memory leak after restore error X-Git-Tag: Release-11.3.2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1e29fa3f2f68ba67df561662718da8927c75945;p=thirdparty%2Fbacula.git Fix small memory leak after restore error --- 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;